Daily #18 · 16 October 2026
The error that still worked Hard
What does this print?
t = ([1],)
try:
t[0] += [2]
except TypeError:
pass
print(t)
Show the answer
A: ([1, 2],)
Why: += on a list does two things: it extends the list in place, then assigns the result back into the tuple. The extend succeeds; the assignment fails, because tuples cannot be assigned to. The list inside was already changed.