I am running the code below, where program = MainFormula()
defines a function used in my program. What I want to achieve is that the program last until the input to the question - "Do you want to change alpha? (Yes/No)" is No. I get what I want, but the program gives me two times "Do you want to change alpha? (Yes/No)" once I reply to the question as "Yes". Can anyone help me to avoid asking "Do you want to change alpha? (Yes/No)" "Do you want to change alpha? (Yes/No)" two times? (just one is needed)
input_value1 = input("Do you want to change alpha? (Yes/No) ").lower()
while input_value1=="yes":
input_value1 = input("Do you want to change alpha? (Yes/No) ").lower()
if input_value1 == "yes":
program = MainFormula() print(program)
else:
print("Congratulations! You are done with the task.")