Ternary using pass keyword python
<p>I have a working conditional statement:</p>

<pre><code>if True:
    pass
else:
    continue
</code></pre>

<p>that I would like to turn it into a ternary expression:</p>

<pre><code>pass if True else continue
</code></pre>

<p>However, Python does not allow this. Can anyone help? </p>

<p>Thanks!</p>

<p><strong>Point 1</strong>: Are your sure your condition is right? Because <code>if True</code> will always be <code>True</code> and code will never go to <code>else</code> block. </p>

<p><strong>Point 2</strong>: <code>pass</code> and <code>continue</code> are not expressions or values, but a action instead You can not use these is one line. Instead if you use, <code>3 if x else 4</code> &lt;-- it will work</p>

python conditional ternary