如果输入,我找不到错误

时间:2018-05-13 18:16:51

标签: 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" 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")

这是我的第一个代码,所以这可能是一个小错误。 谢谢你的答案。

0 个答案:

没有答案
相关问题