Using "or" in if statement conditions
<p>I'm sure there is a really simple answer to this but I can't find it after searching around for a while.</p>

<pre><code>prefixes = "JKLMNOPQ"
suffix = "ack"

for letter in prefixes:
    if letter == "Q" or letter == "O":
        print letter + "u" + suffix
    else:
        print letter + suffix
</code></pre>

<p>The above code works perfectly, the condition on the if statement seems a bit long-winded so I tried:</p>

<pre><code>if letter == "Q" or "O":
</code></pre>

<p>which is shorter but doesn't work. I worked out that it doesn't work because "O" is a boolean expression which will always be True and that it doesn't consider anything on the left side of "or".</p>

<p>I tried putting brackets around it like so:</p>

<pre><code>if letter == ("Q" or "O"):
</code></pre>

<p>but that only matches Q and not O.</p>

<p>Is there any shorthand way of getting the code to work or do I have to use the long-winded way that's working for me?</p>
