Answers for "python if one of few variable equals"

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")
Posted by: Guest on December-15-2020

Code answers related to "python if one of few variable equals"

Python Answers by Framework

Browse Popular Code Answers by Language