<div class="gmail_quote">On 5 July 2010 12:53, Richard D. Moores <span dir="ltr">&lt;<a href="mailto:rdmoores@gmail.com">rdmoores@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">On Mon, Jul 5, 2010 at 04:09, Stefan Behnel &lt;<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>&gt; wrote:<br>
&gt; Richard D. Moores, 05.07.2010 11:37:<br>
&gt;&gt;<br>
&gt;&gt; I keep getting hung up over the meaning of &quot;the return<br>
&gt;&gt; value&quot; of an expression. I am of course familiar with values returned<br>
&gt;&gt; by a function, but don&#39;t quite grasp what the return value of, say,<br>
&gt;&gt; the y of &quot;x and y&quot; might mean.<br>
&gt;<br>
&gt; Think of a different expression, like &quot;1+1&quot;. Here, the return value (or<br>
&gt; maybe a better wording would be the result value) is 2.<br>
&gt;<br>
&gt;<br>
&gt;&gt; Also, you distinguish between a return value of True and and the value<br>
&gt;&gt; of y being such (say 5, and not 0) that it makes y true (but not<br>
&gt;&gt; True). So another  thing I need to know is the difference between True<br>
&gt;&gt; and true.  Also between False and false. And why the difference is<br>
&gt;&gt; important.<br>
&gt;<br>
&gt; &quot;True&quot; is the value &quot;True&quot; in Python, which is a singleton. You can test for<br>
&gt; it by using<br>
&gt;<br>
&gt;    x is True<br>
<br>
</div>Ah. But could you give me an x that would satisfy that? I can think of<br>
<br>
&gt;&gt;&gt; (5 &gt; 4) is True<br>
True<br>
<br>
But how can (5 &gt; 4) be an x? Could you show me some code where it could be?<br>
<br>
&gt;&gt;&gt; x = (5 &gt; 4)<br>
&gt;&gt;&gt; x<br>
True<br>
&gt;&gt;&gt; x is True<br>
True<br>
<br>
So it can! That surprised me.  I was expecting   &quot;x = (5 &gt; 4)&quot;  to be<br>
absurd -- raise an exception? Still seems pretty weird.<br></blockquote><div><br>Greater than (&gt;) works like the mathematical operators in returning a value, it just happens that for comparison operators (&gt;, &lt;, ==, !=) the values can only be True or False.<br>

<br>HTH,<br>Adam.<br></div></div>