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><code>if</code> does not test for <code>== True</code>. It tests for the <a href="https://docs.python.org/3/library/stdtypes.html#truth-value-testing" rel="nofollow"><em>truth value</em></a> of an object:</p>

<blockquote>
  <p>Any object can be tested for truth value, for use in an <code>if</code> or <code>while</code> condition or as operand of the Boolean operations below.</p>
</blockquote>

<p>Objects are normally always considered <em>true</em>, except for the <code>False</code> or <code>None</code> objects (on their own), numeric zero, or an <em>empty</em> container.</p>

<p><code>(False,)</code> is a tuple with one element, and any tuple that is not empty is considered a <em>true value</em>, because it is not an empty container.</p>

<p>You can use the <a href="https://docs.python.org/3/library/functions.html#bool" rel="nofollow"><code>bool()</code> function</a> to get a boolean <code>True</code> or <code>False</code> value for the truth value:</p>

<pre><code>&gt;&gt;&gt; tup = (False,)
&gt;&gt;&gt; bool(tup)
True
&gt;&gt;&gt; bool(tup) == True
True
</code></pre>

python tuples