Question 1
Back to Exercise
The program below stops with an error. Which statement correctly describes the problem?
resolution = (1920, 1080)
resolution[0] = 1280
print(resolution)
- A IndexError: index 0 out of range
- B It prints (1280, 1080)
- C TypeError: tuples are immutable; build a new tuple: resolution = (1280, resolution[1]) Correct
- D ValueError: 1280 is too small
Correct Answer: Option C
Rebind the name to a new tuple, or use a list if the values must change.
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!