print(6 and 0 or 5==9 and 4 and '7' or 0 and 8)
print(4 or 8 and 56==0 or 5 and 0 or 5 and 'hoe' or 0 and 'f')
what is the order of computation of multiple logical operators in python? is it sequentially from either side?
print(6 and 0 or 5==9 and 4 and '7' or 0 and 8)
print(4 or 8 and 56==0 or 5 and 0 or 5 and 'hoe' or 0 and 'f')
what is the order of computation of multiple logical operators in python? is it sequentially from either side?
It follows the precedence order as defined in operator precedence.
In short, NOT > AND > OR.
Your code translates to:
(6 and 0) or (5==9 and 4 and '7') or (0 and 8)
(4) or (8 and 56==0) or (5 and 0) or (5 and 'hoe') or (0 and 'f')