A program copies a list that has a list inside it, then changes the copy in three different ways. a = [1, [2, 3]] b = a[:] b[0] = 9 b[1].append(4) b[1] = [0] print(a, b) What does the program print?
[1, [2, 3]] [9, [0]]
[9, [0]] [9, [0]]
[1, [2, 3, 4]] [9, [0]]
[1, [2, 3, 4]] [9, [2, 3, 4]]
Log in to join the discussion.
Loading…