Vidyalelo
Python · Q5

Decorators in Depth

Programming · Python · question 5

Q5

What is a common use case of decorators?

A.
Replacing built-in functions
B.
Adding logging or authentication to functions
Answer
C.
Removing error handling from functions
D.
Changing the function's name

Answer: Option B

Solution

Answer: Option B
Solution:
Decorators are often used to add features like logging, authentication, or authorization to functions.