A = X > Y ? X : Y
François Pinard
pinard at iro.umontreal.ca
Tue Feb 8 20:59:27 EST 2000
Brad Howes <bradh at mediaone.net> writes:
> Curtis Jensen <cjensen at be-research.ucsd.edu> writes:
> Its in the FAQ -- and its not as pretty:
> a = ( ( x > y ) and x ) or y
> Seems to work fine for numbers -- not sure about objects or strings.
If really in the FAQ, it should not be. It surely does not work when x
is 0, and y is less than 0.
--
François Pinard http://www.iro.umontreal.ca/~pinard
More information about the Python-list
mailing list