Как бы я превратил это в цикл 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")
большое спасибо
select_option1 = None
while(select_option1!='BEEF'and select_option1!='CHICKEN' and select_option1!='FISH'):
flag=True
select_option1 = str(input("Please pick one of the following protiens: FISH, CHICKEN, BEEF:\n"))
while(select_option1=='BEEF'):
print("You picked BEEF")
flag=False
break;
while(select_option1=='CHICKEN'):
print("You picked CHICKEN")
flag=False
break;
while(select_option1=='FISH'):
print("You picked FISH")
flag=False
break;
while(flag):
print("Please select a protien from the list given")
flag=False