Trinary operator?

Martin v. Loewis martin at v.loewis.de
Wed Apr 17 14:40:06 EDT 2002


"Philipp Lenssen" <lenssen at hitnet.rwth-aachen.de> writes:

> Not that it's a big deal since there's many ways to do that, but can I use
> something like
>     verboseGender = (gender == 'm') ? 'male' : 'female'
> in Python?

http://www.python.org/doc/FAQ.html#4.16

HTH,
Martin



More information about the Python-list mailing list