Creating the prompt() function
Let us define the prompt for making another transaction:
def prompt():
prompt = input("Would you like to make another transaction? (y/n) \n>>>")
if prompt is "y":
menu()
elif prompt is "n":
pass
else:
prompt()
Like before, we make a new variable called “prompt”, include the choices in the input (y/n), and then add a string of “>>>”.
If the user inputs “y”, then we simply repeat the menu. If the user inputs “n”, then we “pass” and end the code. Any other input will repeat the prompt text.