a=[1,2,3,4].reverse() - why "a" is None?
Nadav Chernin
Nadav.C at qualisystems.com
Mon Oct 12 04:44:02 EDT 2009
Chris Withers wrote:
...becauase you were looking for:
reversed([1,2,3,4])
OK, but my question is generic. Why when I use object's function that
changed values of the object, I can't to get value of it on the fly
without writing additional code?
>>> a=[1,3,2,4]
>>> a.sort()
>>> a.reverse()
>>> a
[4, 3, 2, 1]
Why I can't a==[1,3,2,4].sort().reverse() ?
More information about the Python-list
mailing list