5 % 4 // 6 % 3
o/p is 0, but according to operator precedence it should raise a ZeroDivisionError because it should be interpreted as
5 % 0 % 3
resulting in an error
Can somebody please elaborate how operator precedence works here?
5 % 4 // 6 % 3
just evaluates left to right so
5%4 = 1
1//6 = 0
0%3 = 0
they are all at the same precedence level https://docs.python.org/3/reference/expressions.html#operator-precedence