Skip to main content
1 of 2
khelwood
  • 59.7k
  • 14
  • 91
  • 116

Despite lots of arguments to the contrary,

6 and 1 in lis 

means

6 and (1 in lis) 

It does not mean:

(6 and 1) in lis 

The page that Maroun Maroun linked to in his comments indicates that and has a lower precedence than in, so the in will be evaluated first.

You can test it like this:

0 and 1 in [0] 

If this means (0 and 1) in [0] then it will evaluate to true, because zero is in [0].

If it means 0 and (1 in [0]) then it will evaluate to zero, because 0 is false.

It evaulates to zero.

khelwood
  • 59.7k
  • 14
  • 91
  • 116