A tuple holds a list. The program changes the list and then tries to change the tuple. t = (1, [2, 3], 4) t[1].append(5) print(len(t), t[1]) t[2] += 1 What happens when the program runs?
3 [2, 3, 5]
3 [2, 3]
TypeError
Log in to join the discussion.
Loading…