So, I made a survey for school and I have to make a program that prints how many people chose the third option (c) of the second question using the information from the survey. Then I had to print how many people took the survey according to the survey data. Then I had to ask which question results they want to view. And if the number they put in is not in the 1,2,3 range it is supposed to print "That is not a question!" and then it goes back to the same code:
choice = int(input("Which question's results would you like to see? "))
But it just keeps on printing "That isn't a question" over and over again until the the system closes my consol. Here is my whole code:
print ("1 person that took the survey said they like C (sandwich)")
print ("7 people took the survey")
choice = int(input("Which question's results would you like to see? "))
while choice not in [1,2,3]: print ("That isn't a question!")
choice = int(input("Which question's results would you like to see? ")
If you are wondering what survey I am talking about you can find it here: https://docs.google.com/forms/d/e/1FAIpQLSdvKS6JsLzT4_bIkMOq6IOIn1c_1tsCG78bm4f4rr_5P75rMA/viewform?usp=sf_link