Question 3
Back to Exercise
What is the output of the following Python program?
t = (1, [2, 3])
t[1].append(4)
print(t, len(t))
- A TypeError
- B (1, [2, 3], 4) 3
- C (1, [2, 3]) 2
- D (1, [2, 3, 4]) 2 Correct
Correct Answer: Option D
The tuple still holds the same two objects; one of them, a list, grew.
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!