Question 2
Back to Exercise
What is the output of the following Python program?
t = 1, 2, 3
a, b, c = t
print(t, a + c)
- A 1 2 3 4
- B (1, 2, 3) 4 Correct
- C [1, 2, 3] 4
- D (1, 2, 3) 13
Correct Answer: Option B
1, 2, 3 packs a tuple; unpacking gives a = 1, c = 3.
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!