On Oct 28, 2008, at 9:45 , RC wrote:

unsortedList = list(["XYZ","ABC"])

sortedList = unsortedList.sort()
print sortedList


the sort method is in-place, so it modifies the object which calls it, and doesn't return anything:

In [1]:unsortedList = list(["XYZ","ABC"])

In [2]:sortedList = unsortedList.sort()

In [3]:print sortedList
None

In [4]:print unsortedList
['ABC', 'XYZ']

or, better, just:

In [5]:unsortedList = list(["XYZ","ABC"])

In [6]:unsortedList.sort()

In [7]:print unsortedList
['ABC', 'XYZ']


                                                bb

--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to