Daily #13 · 11 October 2026
A copy that is not Medium
What does this print?
a = [[1], [2]] b = a.copy() b[0].append(9) print(a)
Show the answer
D: [[1, 9], [2]]
Why: copy() makes a new outer list holding the same inner lists. Appending to b[0] changes the list both of them point at. copy.deepcopy(a) copies all the way down.