[Tutor] Number of elements in a list

Kent Johnson kent_johnson at skillsoft.com
Fri Aug 13 23:08:45 CEST 2004


print len(myList)

It's not a member function, it's a builtin.

Kent

At 11:02 PM 8/13/2004 +0100, Bernard Lebel wrote:
>A very basic question: how can I print the number of elements in a list? I'm
>not talking about the elements, just their count...
>
>Something like
>
>print myList.length
>or
>print myList.count
>
>
>Thanks
>Bernard
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list