Vidyalelo
Python · Q22

Decorators in Depth

Programming · Python · question 22

Q22

What is a memoization decorator used for?

A.
To add logging to functions
B.
To modify function behavior
C.
To cache function results
Answer
D.
To validate function inputs

Answer: Option C

Solution

Answer: Option C
Solution:
A memoization decorator is used to cache the results of a function to improve performance.