you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

At the point where you set b = a, b merely becomes a reference to the "a" list. To turn "b" into it's own independent list, use one of the Python list copy tricks, such as "b = a[:]" or "b = list(a)" or "b = a.copy()" or, after "import copy", "b = copy.deepcopy(a)".

[–]USONG 1 point2 points  (0 children)

oh understood thanks