← Quiz: Python Decorators: all 10 questions
Quiz: Python Decorators · Question 5 of 10
Why should a wrapper use args, kwargs?
Why should a wrapper use *args, **kwargs?
- A.They make the wrapper faster
- B.Python requires them in every inner function
- C.So the decorator works for functions with any arguments
- D.They turn the function into a generator
Answer & explanation
Correct answer: So the decorator works for functions with any arguments
The wrapper accepts whatever was passed and forwards it unchanged.
Can you get the rest right without peeking?
Take the timed Quiz: Python Decorators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →