如何在python中将问题转换为while循环

时间:2018-12-01 17:34:05

标签: python while-loop

我该如何将其转换为while循环,以便用户被迫从三个选项中选择一个以继续前进。.

select_option1 = None
print("Please pick one of the following protiens: FISH, CHICKEN, BEEF")
select_option1 = input()
if select_option1 == "beef":
print("You picked BEEF")
elif select_option1 == "chicken":
print("You picked CHICKEN")
elif select_option1 == "fish":
print("You picked FISH")
else:   
print("Please select a protien from the list given")

非常感谢

0 个答案:

没有答案