Python – Logical Operators
Logical operators are used to combine conditional statements.
and: Returns True if both statements are true.
x = True
y = False
print(x and y) # Output: False
or: Returns True if at least one of the statements is true.
print(x or y) # Output: True
not: Reverses the result, returns False if the result is true.
print(not x) # Output: False