← Quiz: Python Decorators: all 10 questions
Quiz: Python Decorators · Question 2 of 10
@timer above def load(): is the same as which line?
@timer above def load(): is the same as which line?
- A.load = load(timer)
- B.timer(load())
- C.load = timer(load)
- D.timer = load(timer)
Answer & explanation
Correct answer: load = timer(load)
The function is passed to the decorator, and the result replaces the name.
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 →