我想检查一个变量是否具有多个值之一。我很困惑为什么or
在这种情况下不起作用。我正在按照给出示例的教程进行if (a or b):
操作,但是当我尝试这样做时,它只会根据第一个值检查变量。我的支票有什么问题?
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"