Apr-11-2019, 05:03 PM
The problem is that you are not creating a copy. Lists are mutable, and as a consequence list variables are actually pointers to the lists rather than the lists themselves. So
C2 = C1
just makes C2 point to the same list C1 points to. The easiest way to copy a list is with a full list slice (C2 = C1[:]
. Note that this is a "shallow" copy. Any lists within the copied lists will still be references to their original list.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures