Mr. Editor-in-chief Mr. Editor-in-chief January 25, 2026 Updated April 24, 2026

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