[Tutor] counting a list of elements

Emile van Sebille emile at fenx.com
Fri Apr 1 20:03:59 CEST 2011


On 4/1/2011 10:16 AM Karim said...

> I would like to get advice on the best practice to count elements

Well, I suspect you're more interested in knowing the total count of how 
many as opposed to counting how many.  To get the total count of how 
many use len(mylist).

Emile



More information about the Tutor mailing list