Ternary Operator in Python

Sunnan sunnan at handgranat.org
Sat Apr 2 07:05:04 EST 2005


Robert Kern wrote:
> Sunnan wrote:
>> (((0.0 < a) < 1.0) < b ) < 2.0
> 
> 
> Go on. Try it with a bunch of different values.
> 
My bad. (Of course. The subexpressions must return booleans, not the 
largest number. It couldn't work any other way.) Egg on my face, and all 
that (figuratively speaking).

Not used to infix...



More information about the Python-list mailing list