0

Sorry for the titlegore, but I can't think of a better way to describe it.

Just to show what I mean, this:

a = ['1', '2', '3']
b = a
b.remove(b[0])
print(b)
print(a)

outputs this:

['2', '3']
['2', '3']

when I expected this:

['2', '3']
['1', '2', '3']

Why is this? How would I go about deleting something from the second list while keeping the first the same?

Kurt Ferrier
  • 73
  • 3
  • 10

0 Answers0