Re: [Tutor] index of max value in a list

2006-12-25 Thread Kent Johnson
anil maran wrote: > the max function, it returns the maximum value in the > list rather than the index associated with that value. > > How do I return the index? l.index(max(l)) will give you the index of the first occurrance of the maximum. m = max(l) [ i for i,v in enumerate(l) if v==m ] wil

[Tutor] index of max value in a list

2006-12-25 Thread anil maran
the max function, it returns the maximum value in the list rather than the index associated with that value. How do I return the index? thanks Anil __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yaho