Python Code Example: if else statement on boolean expressions

Logical operators have different priorities and therefore are executed at different times.

The order is as follows:
Logical complements (not) are executed first,
logical conjunctions (and) are executed next,
and logical disjunctions (or) are executed at the end.

a, b, c = True, False, True

if a or b and c:
    print("True")
else:
    print("False")
Output
True