Question: How do I make this work so if I answer with anything other than yes or no it loops back and asks for input? v

How do I make this work so if I answer with anything other than yes or no it loops back and asks for input?

v = 1 while v == 1: ans1 = input("Do you want to replace phrases?: ") ans1 = ans1.upper() if ans1 == "yes".upper():

acro_string = acronym(main_string) v = 2 elif ans1 == "no".upper(): acro_string = main_string v = 2 else: print("Please answer yes or no. Do you want to replace phrases?: ") v = 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!