On 25/06/12 14:39, Puneeth Chaganti wrote:

`sorted`[0] returns a new list unlike `sort`[1], which sorts a list in-place.

Something like this, would work:

words = sorted(words)
x_list = sorted(x_list)

or just

words.sort()
x_list.sort()

which will work in place as mentioned above.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to