Apr-11-2019, 05:06 PM
C1=[7,3,6,5,4,2,1] C2=C1This is just making
C2
also point at the same object as C1
To make a new copy of the list use
c2 = c1[:]or
c2 = list(c1)
Sorting a copied list is also sorting the original list ?
|
|
Messages In This Thread |
Sorting a copied list is also sorting the original list ? - by SN_YAZER - Apr-11-2019, 04:49 PM
RE: Sort list - by ichabod801 - Apr-11-2019, 05:03 PM
RE: Sort list - by Yoriz - Apr-11-2019, 05:06 PM
RE: Sorting a copied list is also sorting the original list ? - by SN_YAZER - Apr-11-2019, 05:10 PM
|