On Mon, Oct 12, 2009 at 4:44 AM, Nadav Chernin nada...@qualisystems.com wrote:
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
--
http://mail.python.org/mailman/listinfo/python-list
The reverse function is a function to reverse the list in place, not a
function to get the reverse of the list:
x = [1,2,3,4]
y = x
z = x.reverse()
will result in:
x = y = [4,3,2,1]
z = None
--
André Engels, andreeng...@gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
Andre Engels wrote:
The reverse function is a function to reverse the list in place, not a
function to get the reverse of the list:
x = [1,2,3,4]
y = x
z = x.reverse()
will result in:
x = y = [4,3,2,1]
z = None
.reverse returns None. See the documentation.
--
Erik Max Francis
...becauase you were looking for:
reversed([1,2,3,4])
Chris
--
Simplistix - Content Management, Batch Processing Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list
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()
Nadav Chernin wrote:
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]
On Mon, Oct 12, 2009 at 10:44 AM, Nadav Chernin
nada...@qualisystems.com wrote:
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