in Python

Andrew Koenig ark at acm.org
Thu Dec 15 21:20:48 EST 2005


"Andy Leszczynski" <yahoo at nospam.leszczynscy> wrote in message 
news:paudnWJmxOHh5j3enZ2dnUVZ_tadnZ2d at comcast.com...
> How can do elegantly in Python:
>
> if condition:
>    a=1
> else:
>    a=2

I believe that before long Python will support

    a=1 if condition else 2






More information about the Python-list mailing list