Operator precedence. Bitwise operations have higher precedence than equality comparison operator, so your bitwise operation is being computed as:
print (year%4 == (0 & (year%100==0 or year%400==0)))
0
solved Difference between & and and in python [duplicate]