🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.They make the wrapper faster
  2. B.Python requires them in every inner function
  3. C.So the decorator works for functions with any arguments
  4. 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 →