Alan Gauld wrote:

> or a slightly sneaky but faster version:
> 
> def howMany(aList):
>     return aList.index(aList[-1]) + 1

Sorry, but this isn't "slightly sneaky", this is outright wrong.
I fails for both empty lists and lists with duplicate entries.



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

Reply via email to