max() of a list of tuples

Jp Calderone exarkun at intarweb.us
Wed Jan 22 11:56:00 EST 2003


On Wed, Jan 22, 2003 at 04:47:14AM -0800, Peter Abel wrote:
> [snip]
> 
> reduce(lambda y,x:y[2]>x[2] and y or x,l,l[0])

reduce(lambda y,x:y[2]>x[2] and y or x,l[1:],l[0])

  Jp

-- 
 12:00am up 37 days, 9:48, 2 users, load average: 0.36, 0.32, 0.27
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030122/0c953e0f/attachment.sig>


More information about the Python-list mailing list