if x = y or z python code example
Example 1: How to test multiple variables against a value?
x = 0
y = 1
z = 3
if 0 or 1 or 2 or 3 == x:
print("This will not work")
if x == 0 or x == 1 or x == 2 or x == 3:
print("This will work")
Example 2: test multiple variables against a value python
if 1 in (x, y, z):