Hola,

Pardon me if I am repeating others, I think I have read the whole thread
now.

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 ]

Best regards,

-Isaac


Bob said:

Take a look in 5.9 Comparisons in the Language Reference:

"Comparisons can be chained arbitrarily, e.g., |x < y <= z| is
equivalent to |x < y and y <= z|, except that |y| is evaluated only once
(but in both cases |z| is not evaluated at all when |x < y| is found to
be false)."

Applying this to

item == item in word2

yields:

(item == item) and (item in word2)
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to