How to loop back to the right line?
I am so new to coding, and here is my question: 1) I am writing this interactive calculator code, basically the user has to input two numbers. so, if the user fail to input the first number(for example, maybe user input alphabet not numbers ), it will loop back and ask for the first number, and if the user fail to input the second number, I want it to loop back and ask the second number again, but my code always loop back to ask the first number... any ideas? (2018 09 27 edited) first_time = True while True: if first_time == True: print("Here are your options:" + "\n") print("Enter one of those functions to continue:") print("(add, subtract, multiply, divide, quit)") first_time = False user_input = input("Enter your option here: " + "\n") if user_input == "quit": break elif user_input == "add": # while user_input == "add": while True: num1 = (input("Enter a number: ")) if not (num1.isalpha()): break else: print ("(number only...)") continue while True: num2 = (input("Enter the second number: ")) if (num2.isalpha()): print ("(number only, please...)") continue else: result = float(num1) + float(num2) print("The answer is " + "\n>>> " + str(result)) print() break