Question 8
Back to Exercise
b = a.copy() where a = [[1], [2]]. Which change to b also affects a?
- A b[0].append(9) Correct
- B b.append([3])
- C b[0] = [7]
- D b.clear()
Correct Answer: Option A
copy() makes a new outer list, but its items are the same inner lists, so mutating an inner list is visible in both.
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!