what does 'and' N 'or' exactly mean in python?
<p>im really confusing now, in my program thought model if you met an expression like these</p>

<p>expr = expr1 and expr2</p>

<p>which mean the expr's type must be Boolean,same thing to 'or' operations</p>

<p>see the codes below, suppose the three lines will print booleans</p>

<pre><code>print(1==1 and 3)
print(1==2 and 3)
print(1==2 and 3 or 4)
</code></pre>

<p>but the result is</p>

<pre><code>3
False
4
</code></pre>

<p>i have to restudy the basic programming :</p>

<p>the true meaning of and and or
'e1 and e2' means evaluate e1 if the result is False return False else return e2
'e1 or e2' means evaluate e1 if the result is True return True else return e2</p>

<p>do i get it right?</p>
