Idiom for 'the lesser of the two'?

John Burton john.burton at jbmail.com
Fri Oct 18 22:30:16 CEST 2002


"Gordon Airport" <uce at ftc.gov> wrote in message
news:A6udnSqYRcfk-C2gXTWcqA at comcast.com...
> There's got to be something simple I'm missing...
> You obviously can't do
> a < b ? a : b
> and this
> a if a < b else b
> is a syntax error. I started playing with lambda functions
> but I didn't have any luck there either.

min(a,b)





More information about the Python-list mailing list