🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Decorators: all 10 questions

Quiz: Python Decorators · Question 10 of 10

Which of these is a typical real use of decorators?

Which of these is a typical real use of decorators?

  1. A.Declaring the type of a variable
  2. B.Checking that a user is logged in before a page function runs
  3. C.Importing a module
  4. D.Defining a loop
Answer & explanation

Correct answer: Checking that a user is logged in before a page function runs

Web frameworks use decorators for login checks, routing and caching.

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 →