Tuple Unpacking
Predict Output Easy
Question
What does this code print?
Code
a, b, c = (1, 2, 3)
print(b)
Hint
b gets the second element.
Explanation
Tuple unpacking assigns a=1, b=2, c=3. print(b) outputs 2. This works with any iterable of matching length.
Related Resources
Related Lessons
- Data Types
Learn Python data types.
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.