What is the correct fix?
a = [1, 2, 3] b = a b.append(4) print(len(a))
- Copy it with
b = a[:]instead - Copy it with
b = a[0]instead - Change
b.append(4)tob + [4] - Declare
bbeforeais created
b = a binds the same list, so appending is visible through a; slice to copy it.