我正在用python进行Pizziera体验,遇到了一些问题,因为我想知道如何向if语句添加几个字符串选项
下面是我试图运行的代码:
menu = (" Happy Ham's Pizza Hut \n\nSIZES \nLarge pizza (20in.) \nMedium pizza (15in.) \nSmall pizza (personel 10in.)\n")
menu += ("\nTYPES \nVegan pizza(non-dairy cheese, tofu pepporoni)\nVegatarian pizza(ground-corn crust, graded radish cheese alternative, cucumber rounds)")
name = str(input(" \n Hello, and welcome to happy ham's pizza hut! \nWould you like a menu? \n >>"))
if name == ('yes, yes please'):
print(menu)
现在的问题是,在做if语句时,我希望它对几个不同的答案有相同的响应。我该怎么做
这是完整的固定代码
只要几处改动,一切看起来都很好
相关问题 更多 >
编程相关推荐