I am trying to make a prompt generator, where the user chooses between simple or complex prompts. The MAIN function is meant to repeat after the user makes their choice but the if statement I’ve written for it (reduced to its barebone) skips straight to the else result. I know if statements and the like will default to else should all other options produce false or fail, but I can’t seem to figure out why that happens here.
def Ask():
answer = input("Do you want a simple (1) or complex (2) prompt?: ")
return answer
def Simple():
print("Simple has been executed")
def Complex():
print("Complex has been executed")
def MAIN():
user_choice = Ask()
if user_choice == 1:
Simple()
MAIN()
elif user_choice == 2:
Complex()
MAIN()
else:
print("Please only type 1 or 2.")
MAIN()
MAIN()