&is a bitwise AND operator . As mentioned in the documentation , bitwise operators have higher priority than logical operators, therefore
0 == 0 & 1 == 1
becomes
0 == (0 & 1) == 1
And you can imagine that it goes down:
0 == (0 & 1) == 1
=> 0 == 0 == 1
=> 0 == 0 and 0 == 1
=> True and False
=> False
Assuming what you want is a logical AND , the python method for this would use and:
0 == 0 and 1 == 1
Which gives you True, as you expected.