max() of a list of tuples

Mario Wehbrink wehbrink at web.de
Tue Jan 21 04:58:14 EST 2003


Hi,

i have a list of tuples that look like:
[(1,3,5), (8,16,2), (2,56,4)]

what i am interested, in is the tuple with the greatest value in pos 3.
So in this case it would be (1,3,5). Is there a way to tell
max(mylistoftuples) to only look at the last position of the tuples?


Mario

-- 
http://www.porcupinetree.com




More information about the Python-list mailing list