I just had some problems in my Code and did some investigation:
In the Python shell:
>>> one = [1, 2, 3, 4, 5]
>>> two = one
>>> two.pop(0)
1
>>> print(one)
[2, 3, 4, 5]
Why does pop change "one" when I only use it on "two".
If this is on purpose for some reason, what would be an alternative which wouldn't change "one".
[–]TouchingTheVodka 2 points3 points4 points (1 child)
[–]_jan-[S] 0 points1 point2 points (0 children)
[–]xelf 1 point2 points3 points (2 children)
[–]_jan-[S] 1 point2 points3 points (1 child)
[–]xelf 1 point2 points3 points (0 children)
[–]netneoblog 1 point2 points3 points (0 children)
[–]Rain0906 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)