or boolean python code example
Example 1: python boolean operators
>>> # The not operator is the opposite of it
>>> not True
False
>>> not False
True
>>> # The and operator is True only if both are are true
>>> True and True
True
>>> False and True
False
>>> False and False
False
>>> # The or operator is True if either of them are true
>>> True or True
True
>>> False or True
True
>>> False or False
False
Example 2: python or
x = 1
y = 10
if x%2 == 0 or y%2 == 0:
print(x%2)
#Output#
#1