Append modifies the array as a side effect.  It has no
meaningful return value.

>>> x = [1, 2, 3]
>>> x.append(4)
>>> print x
[1, 2, 3, 4]

- Jeff Younker - [EMAIL PROTECTED] - 510.798.5804 -


On Nov 11, 2007, at 8:21 PM, Ryan Hughes wrote:


Hello,

Why does the following not return [1,2,3,4] ?

>>> x = [1,2,3].append(4)
>>> print x
None
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to