On Apr 25, 2007, at 1:58 AM, Alchemist wrote:

> What is Python's version for the trinary if..then..else operator?
>
> I want a one-liner such as
>   a?b:c
> for the if..then..else control structure
> if a
>   then b
>   else c
>
> Does Python 2.4 support it?

Not precisely, but you can *usually* get away with:

a and b or c



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to