I want to check if a variable has one of multiple values. I'm confused about why or
doesn't work in this situation. I was following a tutorial that gave the example if (a or b):
, but when I try to do this it only checks the variable against the first value. What is wrong with my check?
name = raw_input('Please type in your name:')
if len(name) < 5:
print "Your name has fewer than 5 characters"
elif len(name) == 5:
print "Your name has exactly 5 characters"
if name == ("Jesse" or "jesse"):
print "Hey Jesse!"
else:
print "Your name has greater than 5 characters"