Python 如果有输入,我可以';我找不到错误
这个代码怎么了?我可以输入我想要的任何东西,它会打印“Nice” 这是我的第一个代码,所以可能是个小错误。 谢谢你的回答。Python 如果有输入,我可以';我找不到错误,python,python-3.x,Python,Python 3.x,这个代码怎么了?我可以输入我想要的任何东西,它会打印“Nice” 这是我的第一个代码,所以可能是个小错误。 谢谢你的回答。“苹果”或“苹果”总是正确的,或者更准确地说“苹果”被认为是正确的,任何或正确的都是正确的。 print ("Hi and welcome to our online shop.\n\nWhich fruit would you like to buy? Apple, Banana or Strawberry?") x = input() if x is "Apple"
“苹果”或“苹果”
总是正确的
,或者更准确地说“苹果”
被认为是正确的
,任何或正确的都是正确的
。
print ("Hi and welcome to our online shop.\n\nWhich fruit would you like to buy? Apple, Banana or Strawberry?")
x = input()
if x is "Apple" or "apple":
print ("Nice.")
elif x is "Banana" or "banana":
print ("Great.")
elif x is "Strawberry" or "strawberry":
print ("Cool.")
else:
print ("Please enter a avaliable product")