15 Functions & Scope 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 declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
B.a parameter form that collects extra positional arguments into a tuple
C.an anonymous, single-expression function created inline without a def statement
D.a parameter form that collects extra keyword arguments into a dictionary
Answer + AI explanation with Pro
2. Which term means: "a parameter form that collects extra positional arguments into a tuple"?
Junior
A.lambda
B.nonlocal
C.*args
D.LEGB rule
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.*args — a parameter form that collects extra positional arguments into a tuple
B.*args — an anonymous, single-expression function created inline without a def statement
C.*args — a parameter form that collects extra keyword arguments into a dictionary
D.*args — a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
Answer + AI explanation with Pro
4. What is **kwargs?
Junior
A.a parameter form that collects extra positional arguments into a tuple
B.an anonymous, single-expression function created inline without a def statement
C.a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
D.a parameter form that collects extra keyword arguments into a dictionary
Answer + AI explanation with Pro
5. Which term means: "a parameter form that collects extra keyword arguments into a dictionary"?
Junior
A.LEGB rule
B.**kwargs
C.lambda
D.nonlocal
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.**kwargs — an anonymous, single-expression function created inline without a def statement
B.**kwargs — a parameter form that collects extra keyword arguments into a dictionary
C.**kwargs — the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
D.**kwargs — a parameter form that collects extra positional arguments into a tuple
Answer + AI explanation with Pro
7. What is LEGB rule?
Mid
A.the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
B.a parameter form that collects extra positional arguments into a tuple
C.a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
D.a parameter form that collects extra keyword arguments into a dictionary
Answer + AI explanation with Pro
8. Which term means: "the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope"?
Mid
A.LEGB rule
B.nonlocal
C.*args
D.lambda
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.LEGB rule — an anonymous, single-expression function created inline without a def statement
B.LEGB rule — a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
C.LEGB rule — a parameter form that collects extra positional arguments into a tuple
D.LEGB rule — the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
Answer + AI explanation with Pro
10. What is nonlocal?
Senior
A.an anonymous, single-expression function created inline without a def statement
B.a parameter form that collects extra keyword arguments into a dictionary
C.a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
D.a parameter form that collects extra positional arguments into a tuple
Answer + AI explanation with Pro
11. Which term means: "a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local"?
Senior
A.*args
B.nonlocal
C.**kwargs
D.LEGB rule
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.nonlocal — an anonymous, single-expression function created inline without a def statement
B.nonlocal — a declaration that rebinds a name to the nearest enclosing function scope rather than creating a new local
C.nonlocal — a parameter form that collects extra keyword arguments into a dictionary
D.nonlocal — the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
Answer + AI explanation with Pro
13. What is lambda?
Junior
A.the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
B.a parameter form that collects extra keyword arguments into a dictionary
C.a parameter form that collects extra positional arguments into a tuple
D.an anonymous, single-expression function created inline without a def statement
Answer + AI explanation with Pro
14. Which term means: "an anonymous, single-expression function created inline without a def statement"?
Junior
A.**kwargs
B.*args
C.lambda
D.nonlocal
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.lambda — the name-resolution order Python follows: Local, Enclosing, Global, then Built-in scope
B.lambda — a parameter form that collects extra positional arguments into a tuple
C.lambda — a parameter form that collects extra keyword arguments into a dictionary
D.lambda — an anonymous, single-expression function created inline without a def statement
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 Functions & Scope question come with Pro.