Simple question! urgent

Lei Chen llchen223 at hotmail.com
Tue Apr 9 16:48:53 EDT 2002


"Vincent Fiack" <vfiack at webmails.com> wrote in message news:<mailman.1018353258.20452.python-list at python.org>...
> > x = [1,2,3,4]
> >  
> >  How to get NUMBER OF ITEMS in array? I need it for checkin nr of
>  items
> >  in argv[]
> 
> len() is your friend.

Or you can try:

  reduce(lambda x, y: x + y, map(lambda x: 1, x))

Just Kidding :)  len() works fine.



More information about the Python-list mailing list