What is difference between if (False,) and True == (False,)
<p>I learned python 3 last year, but I have barely experience.</p>

<p>I am reviewing about tuple again.</p>

<p>I would like to figure out difference between  <code>if (False,)</code> and <code>True == (False,)</code></p>

<p>Since <code>if (False,):</code> is true, but <code>True == (False,)</code> is false, I am very confused.</p>

<p>For any <code>x</code> whatsoever,</p>

<pre><code>if (x,):
</code></pre>

<p>succeeds, because <code>(x,)</code> is a non-empty tuple, and all non-empty tuples evaluate to <code>True</code> in a boolean context.</p>

<p>And again for any <code>x</code> whatsoever,</p>

<pre><code>if True == (x,):
</code></pre>

<p>cannot succeed, because the things being compared aren't even of the same types (for a start, <code>True</code> isn't a tuple).</p>

<p>In your question, what I spelled as <code>x</code> you spelled <code>False</code>, but it makes no difference what value <code>x</code> has:  <code>False</code>, <code>True</code>, the integer 42, a file object, ..., it doesn't matter.</p>

python tuples