I'm trying to figure out if there's a shorter way of writing this if statement (wrote a very basic, unrealistic if statement just so it's easy to see the point.
x = 3
if x == 1 or x == 2 or x == 3 or x==4:
print x
else:
print "nope"
I would like to write something along the lines of:
if x == or(1,2,3,4):
is there any way of doing that? Or do I have to write out every option?
Thanks, Sean