我已经设定了如果'是啊'在输入它输出一定的责任,但我希望它理解是,是的,是的。这是代码!
name = raw_input ("What's your name?")
if 'Sean' in name:
name1 = raw_input("Downey or Paul?")
if 'Downey' in name1:
print ("Hi Sean Downey")
x = raw_input("Did you know that the name is irish?")
if x == 'yea':
print ('oh cool')
elif 'Paul' in name1:
print ("Hi Sean Paul")
else:
print ("I don't know that Sean")
else:
print ('Hi %s') % (name)
答案 0 :(得分:1)
您可以将确认放在元组中,并检查元组中是否有x
:
confirmations = ('yeah', 'yes', 'yea')
if x in confirmations:
...