Python Tuple Unpacking
Multiple Choice Easy
Question
After `a, b, c = (1, 2, 3)`, what is `b`?
Hint
Unpacking assigns elements positionally.
Explanation
Tuple unpacking assigns each element to the corresponding variable: a = 1, b = 2, c = 3. So b is 2. The number of variables must match the number of elements, otherwise a ValueError is raised.
Related Resources
Related Lessons
- Tuples
Tuple unpacking.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.