Question 8
Back to Exercise
What is the output of the following Python program?
data = ("Asha", (91, 85))
name, (m1, m2) = data
print(name, m1 + m2)
- A Asha (91, 85)
- B ValueError
- C Asha 9185
- D Asha 176 Correct
Correct Answer: Option D
The target (m1, m2) matches the inner tuple, so both marks are unpacked in one statement.
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!