Inline Conditionals?

Peter Hansen peter at engcorp.com
Thu Aug 26 01:31:25 EDT 2004


Joshua Ginsberg wrote:

> Is there any plan to include inline conditionals in Python? For example:
> 
> def isNegative(x):
> 	return x < 0 ? True : False

This is a FAQ: 
http://www.python.org/doc/faq/programming.html#is-there-an-equivalent-of-c-s-ternary-operator

Newbies, please consider reading the several FAQs that you will find
at http://www.python.org/doc/faq/ before posting questions which
might be answered there (i.e. just about anything).

-Peter



More information about the Python-list mailing list