python (bool) ? then : else syntax?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/394809/python-ternary-operator">Python Ternary Operator</a>  </p>
</blockquote>



<p>In some languages including Java, C/C++, C#, etc. you can assign a value based on the result of an inline boolean expression.</p>

<p>For example,</p>

<pre><code>return (i &lt; x) ? i : x
</code></pre>

<p>This will return i if i &lt; x, otherwise it will return x.  I like this because it is much more compact in many cases than the longer syntax which follows.</p>

<pre><code>if (i &lt; x)
  return i
else
  return x
</code></pre>

<p>Is it possible to use this syntax in python and if so, how?</p>
