I’ve tried Google, but I can’t find the answer to this simple question.
I hate myself for not being able to figure this out, but here we go.
How do I write an if statement with or in it?
For example:
if raw_input=="dog" or "cat" or "small bird":
print "You can have this animal in your house"
else:
print "I'm afraid you can't have this animal in your house."
If you want to use
or, you need to repeat the whole expression each time:But a better way to do this particular comparison is with
in: