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
Get step-by-step solutions from verified subject matter experts
