2011-03-14, 02:19 AM
Simple enough question:
I have two lists. I want to the 2nd one to be a sorted list of the 1st one while keeping the original as it is. Is there a function I can use or would I actually have to separately program it and manually make a new list?
Example of what I don't want happening:
They come out as both being sorted. I'm not quite understanding what's going on here.
I have two lists. I want to the 2nd one to be a sorted list of the 1st one while keeping the original as it is. Is there a function I can use or would I actually have to separately program it and manually make a new list?
Example of what I don't want happening:
Code:
c = [1,5,6,3,2,10]
c_sorted = c
c_sorted.sort()
print c
print c_sortedThey come out as both being sorted. I'm not quite understanding what's going on here.

