max() of a list of tuples

Gerrit Holl gerrit at nl.linux.org
Tue Jan 21 10:17:51 EST 2003


Max M schreef op dinsdag 21 januari om 12:26:46 +0000:
> l = [(1,3,5), (8,16,2), (2,56,4)]

Yet Another possibility, Python 2.3 only:

max([i[::-1] for i in l])[::-1]

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list