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
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?
just evaluates left to right so
they are all at the same precedence level https://docs.python.org/3/reference/expressions.html#operator-precedence