Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 Step (1): Wait for Python 2.5[1] Step (2): Write the code:: a = 1 if condition else 2 STeVe [1]http://www.python.org/peps/pep-0308.html