Vidyalelo
Python · Q2

Decorators in Depth

Programming · Python · question 2

Q2

How is a decorator defined in Python?

A.
Using the @decorator syntax
Answer
B.
By calling the decorator() function
C.
Using the def keyword
D.
Using the modify() keyword

Answer: Option A

Solution

Answer: Option A
Solution:
Decorators are defined using the @decorator_name syntax above a function definition.