Robert Kern wrote:
> Steven Bethard wrote:
>> Can you do something like::
>>
>>      max_val, max_index = max((x, i) for i, x in enumerate(my_list))
>>
>> ?  If any two "x" values are equal, this will return the one with the 
>> lower index.  Don't know if that matters to you.
> 
> Wouldn't it return the one with the highest index?

Yes sorry.  Mentally switched my min and max calls.

Thanks for the catch.

Steve
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to