15 Decorators & Closures questions from the Python bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
B.a nested function that captures and remembers variables from its enclosing scope after that scope has returned
C.a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
D.a method that receives the class itself as its implicit first argument rather than an instance
Answer + AI explanation with Pro
2. Which term means: "a callable that wraps another function to extend its behavior, applied with @ syntax above the definition"?
Junior
A.closure
B.staticmethod
C.decorator
D.classmethod
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.decorator — a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
B.decorator — a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
C.decorator — a method bound to neither the instance nor the class, receiving no implicit first argument
D.decorator — a nested function that captures and remembers variables from its enclosing scope after that scope has returned
Answer + AI explanation with Pro
4. What is closure?
Mid
A.a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
B.a method that receives the class itself as its implicit first argument rather than an instance
C.a method bound to neither the instance nor the class, receiving no implicit first argument
D.a nested function that captures and remembers variables from its enclosing scope after that scope has returned
Answer + AI explanation with Pro
5. Which term means: "a nested function that captures and remembers variables from its enclosing scope after that scope has returned"?
Mid
A.staticmethod
B.functools.wraps
C.classmethod
D.closure
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.closure — a method bound to neither the instance nor the class, receiving no implicit first argument
B.closure — a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
C.closure — a nested function that captures and remembers variables from its enclosing scope after that scope has returned
D.closure — a method that receives the class itself as its implicit first argument rather than an instance
Answer + AI explanation with Pro
7. What is functools.wraps?
Mid
A.a method that receives the class itself as its implicit first argument rather than an instance
B.a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
C.a nested function that captures and remembers variables from its enclosing scope after that scope has returned
D.a method bound to neither the instance nor the class, receiving no implicit first argument
Answer + AI explanation with Pro
8. Which term means: "a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it"?
Mid
A.closure
B.functools.wraps
C.decorator
D.staticmethod
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.functools.wraps — a method that receives the class itself as its implicit first argument rather than an instance
B.functools.wraps — a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
C.functools.wraps — a nested function that captures and remembers variables from its enclosing scope after that scope has returned
D.functools.wraps — a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
Answer + AI explanation with Pro
10. What is staticmethod?
Senior
A.a nested function that captures and remembers variables from its enclosing scope after that scope has returned
B.a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
C.a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
D.a method bound to neither the instance nor the class, receiving no implicit first argument
Answer + AI explanation with Pro
11. Which term means: "a method bound to neither the instance nor the class, receiving no implicit first argument"?
Senior
A.functools.wraps
B.classmethod
C.decorator
D.staticmethod
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.staticmethod — a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
B.staticmethod — a method bound to neither the instance nor the class, receiving no implicit first argument
C.staticmethod — a method that receives the class itself as its implicit first argument rather than an instance
D.staticmethod — a nested function that captures and remembers variables from its enclosing scope after that scope has returned
Answer + AI explanation with Pro
13. What is classmethod?
Senior
A.a nested function that captures and remembers variables from its enclosing scope after that scope has returned
B.a method that receives the class itself as its implicit first argument rather than an instance
C.a helper applied to a wrapper to copy the original function's name, docstring, and metadata onto it
D.a method bound to neither the instance nor the class, receiving no implicit first argument
Answer + AI explanation with Pro
14. Which term means: "a method that receives the class itself as its implicit first argument rather than an instance"?
Senior
A.decorator
B.classmethod
C.closure
D.staticmethod
Answer + AI explanation with Pro
15. Which statement is correct?
Senior
A.classmethod — a callable that wraps another function to extend its behavior, applied with @ syntax above the definition
B.classmethod — a method that receives the class itself as its implicit first argument rather than an instance
C.classmethod — a method bound to neither the instance nor the class, receiving no implicit first argument
D.classmethod — a nested function that captures and remembers variables from its enclosing scope after that scope has returned
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Decorators & Closures question come with Pro.