Python or
is used to combine conditional statements, for example:
>>> x = 1
>>> x < 2 or x > 5
True
>>> x < 1 or x > 5
False
or
will return True if either one of the statements is true, or False otherwise. It’s most frequently used in an if/else statement
if x < 3 or x > 8:
print('x is less than 3 or greater than 8')
else
print('x is not less than 3 or greater than 8')
or
can also be used as a nice shortcut to pick a value that’s not False, 0, or None
>>> 5 or 0
5
>>> None or 8
8
>>> [] or [3]
[3]