[Tutor] trouble with function-- trying to check

Isaac hyperneato at gmail.com
Fri Mar 16 02:46:23 CET 2007


I see. Thanks for clarifying that for me.

-Isaac

On 3/15/07, Kent Johnson <kent37 at tds.net> wrote:
>
> Isaac wrote:
> > In 5.9 of the Language Reference it says:
> >
> > "Comparisons can be chained arbitrarily, e.g., |x < y <= z| is
> > equivalent to |x < y and y <= z"
> >
> > |So this would mean that
> >
> > item == item in word2
> >
> > means:
> >
> > item == item and item in word2
> >
> > not
> >
> > (item == item) and (item in word2)
> >
> > which would first return each value in parentheses and place each value
> > on either side of the boolean operator [ and ]
>
> What do you think your expression does? Since 'and' has a lower
> precedence than == and 'in', the two expressions have the same meaning.
> I added the parentheses for emphasis.
>
> Kent
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070315/05759e4e/attachment.htm 


More information about the Tutor mailing list