expression = input("Enter your expression, q to quit: ") # Terminating condition, quit when expression = q while expression != 'q': print ("The answer is ", eval(expression)) expression = input("Enter your expression, q to quit: ") print ("Thank you for using the calculator")