Vidyalelo
Python · Q8

Decorators in Depth

Programming · Python · question 8

Q8

How do you create a decorator that takes arguments?

A.
Using the @decorator syntax
B.
By using the @decorator(arg) syntax
Answer
C.
By using the @decorator() syntax
D.
By using the decorator(arg) function

Answer: Option B

Solution

Answer: Option B
Solution:
A decorator that takes arguments is applied using the @decorator(arg) syntax.