Strange behavior with sort()

ast nomail at invalid.com
Thu Feb 27 01:24:24 EST 2014


Hello

box is a list of 3 integer items

If I write:

    box.sort()
    if box == [1, 2, 3]:


the program works as expected. But if I write:

    if box.sort() == [1, 2, 3]:

it doesn't work, the test always fails. Why ?

Thx



More information about the Python-list mailing list