← Quiz: Python Decorators: all 10 questions
Quiz: Python Decorators · Question 9 of 10
Which standard-library decorator remembers results so repeated calls are fast?
Which standard-library decorator remembers results so repeated calls are fast?
- A.@staticmethod
- B.@property
- C.@functools.wraps
- D.@functools.lru_cache
Answer & explanation
Correct answer: @functools.lru_cache
lru_cache stores results for each argument and returns them from the cache.
Can you get the rest right without peeking?
Take the timed Quiz: Python Decorators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →