Question 3
Back to Exercise
The program below stops with an error. Which statement correctly describes the problem?
record = ("Asha", 21, "CSE")
name, age = record
print(name, age)
- A ValueError: the tuple has 3 items but only 2 names; add a name or use name, age, *rest = record Correct
- B It prints Asha 21
- C TypeError: record is a tuple
- D IndexError
Correct Answer: Option A
Unpacking is strict about the count unless a starred name absorbs the extras.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!