On Sat, Dec 10, 2011 at 1:11 PM, sunil tech <sunil.tech...@gmail.com> wrote:
> hi,
>
> Consider a list: a = [1,2,3]
>
> & a simple function, which when called it will append 100 to the list.
>
> def app(x):
>      return x.append(100)
>
> p = app(a)
>
> now list holds appended value [1,2,3,100]
> but p is empty... why it is?
>
> please teach.
>
append() Method is a mutator; it modifies the list.

DOES NOT return the modified list; returns None
to be exact

HTH

Asokan Pichai
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to