Python assign a variable use if condition : <p>I want to assign a variable when <code>if</code> statement is true. What's wrong with this assignment?</p>

<blockquote>
  <p>b = 1 if  3 > 2</p>
</blockquote>

<pre><code>File "&lt;stdin&gt;", line 1
    b = 1 if 3 &gt; 2
                 ^
SyntaxError: invalid syntax
</code></pre>
