[Tutor] two ways

Shi Mu samrobertsmith at gmail.com
Fri Nov 11 08:38:15 CET 2005


what is the difference between the two ways of assigning the list?
p=a vs. p=a[:]
>>> a=range(5)
>>> a
[0, 1, 2, 3, 4]
>>> p=a
>>> p
[0, 1, 2, 3, 4]
>>> p=a[:]
>>> p
[0, 1, 2, 3, 4]


More information about the Tutor mailing list