[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: List mutation method gotcha - How well known?

Björn Lindqvist

3/13/2008 3:07:00 PM

On Thu, Mar 13, 2008 at 8:36 AM, Hendrik van Rooyen
<mail@microcorp.co.za> wrote:
> foo = [1,2,3,4]
> x = foo.append(5)
> print x
>
> What will be the output (choose one):
>
> 1) [1,2,3,4]
> 2) [1,2,3,4,5]
> 3) That famous picture of Albert Einstein sticking out his tongue
> 4) Nothing - no output
> 5) None of the above

5


--
mvh Björn