Idiom for 'the lesser of the two'?

Andrew Koenig ark at research.att.com
Fri Oct 18 16:12:19 EDT 2002


Gordon> There's got to be something simple I'm missing...  You
Gordon> obviously can't do a < b ? a : b and this a if a < b else b is
Gordon> a syntax error. I started playing with lambda functions but I
Gordon> didn't have any luck there either.

How about min(a, b)?

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list