Jason Massey wrote:
> John,
> 
> Basically it's not evaluating it the way you think it is:

Right.
> 
> Your first example really equates to:
> 
> if (1 or 5) in rollList:
>    etc...
> 
> (1 or 5) equals 1  and 1 isn't in the your list.

Not quite. It's
   if 1 or (5 in rollList):

Since 1 evaluates to true, the result will always be 1.

Operator precedence is summarized here:
http://docs.python.org/ref/summary.html

Kent

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to