simple newbie question

eugene kim eugene1977 at hotmail.com
Tue Dec 10 21:18:39 EST 2002


what's different in these two..assignment, append?
thank you

listvar1 = [1]
listvar2 = listvar1
listvar2 = [2]

print listvar1, listvar2 ## [1] [2]

-----------------------------

listvar1 = [1]
listvar2 = listvar1
listvar2.append(2)

print listvar1, listvar2 ## [1,2][1,2]




More information about the Python-list mailing list