Why doesn't this work?

Courageous jkraska at san.rr.com
Fri Dec 7 05:06:53 CET 2001


Python 2.2b2 (#26, Nov 16 2001, 11:44:11) [MSC 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>> def f(): return [1,2,3]

>>> f()
[1, 2, 3]
>>> f().append(4)
>>> l=f().append(4)
>>> l
>>> 

Obviously I can fix this, but I'm wondering why it doesn't work
the way I expected it to?

C//




More information about the Python-list mailing list