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