Some help in my moment of stupidness
<p>so I have this project that's due and for one of the questions, after doing all the calculations, you compare two different booleans. So, if both booleans are true the answer will return false, and if both booleans are false it will return false, and it will only return true if one of the booleans are true and the other is false (doesn't matter which)</p>

<p>So lets say the two booleans are A and B</p>

<p>My code looks like this
return A != B</p>

<p>His code looks like this
return ((A and not B) or (B and not A))</p>

<p>Who is right? Are we both right?
Hes like a lot smarter than me so im just wondering if I did some stupid mistake</p>

<p>You are both right, the result is the same.
Just one option is shorter than the other or simpler.</p>

<p>There isn't only one way to solve a problem, as long as the result is right.
Here I offer yet another solution.</p>

<p>You also can use XOR  ^ </p>

<pre><code>t = False
f = False

result = t ^ f
print result
&gt;&gt; False

t = True
f = False

result = t ^ f
print result
&gt;&gt; True

t = False
f = True

result = t ^ f
print result
&gt;&gt; True

t = True
f = True

result = t ^ f
print result
&gt;&gt; False
</code></pre>

python boolean logic