Vidyalelo
Python · Q19

Decorators in Depth

Programming · Python · question 19

Q19

How do you create a custom decorator in Python?

A.
By modifying the built-in decorators
B.
By using the @custom_decorator syntax
C.
By importing decorators from external libraries
D.
By defining a function and using the @ symbol
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
You create a custom decorator by defining a function and using the @decorator_name syntax.