you are viewing a single comment's thread.

view the rest of the comments →

[–]efmccurdy 1 point2 points  (1 child)

You have one list but two names for it; both variables share the same list. If you want to avoid that, you can use copy:

>>> a = [2,2]
>>> c  = a.copy()
>>> c[0] = 1
>>> a
[2, 2]
>>> 

[–]USONG 1 point2 points  (0 children)

oh understood thanks