On 10/04/16 19:36, Peter Otten wrote: > 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.
Oops, quite right. Sorry. Just back from a weeks vacation hence the delayed response... Also why you'll see a bunch of delayed messages from moderation arriving... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor