Pass a list to diffrerent variables.

user at domain.invalid user at domain.invalid
Sun May 2 08:56:32 EDT 2004


When trying to pass the contents from one list to another this happens:

list = [1,2,3]
list1 = list
print list1
  [1,2,3]
list.append(7)
print list1
  [1,2,3,7]

Whats the easiest way to pass the data in a list, not the pointer, to 
another variable



More information about the Python-list mailing list