Precedence of Logical Operators
| Operator | Precedence |
|---|---|
| ! | High |
| && | Medium |
| || | Low |
Here is an example in Python
a, b, c = False, False, True
print(not b or c) # True
print(not (b or c)) # False
print(a and b or c) # True
print(a and (b or c)) # False
| Operator | Precedence |
|---|---|
| ! | High |
| && | Medium |
| || | Low |
Here is an example in Python
a, b, c = False, False, True
print(not b or c) # True
print(not (b or c)) # False
print(a and b or c) # True
print(a and (b or c)) # False