0

I am a beginner and am having trouble looping my calculator. Once the user finishes their equation, I want it to restart if they click any key other than e. However, no matter what I click it will end the program. This is my code:

while True:
    Equation = input("Please enter your equation: ")
    print(str(eval(Equation)))
    
    exit = input("If you would like to exit the progam click 'e': ")
    if exit == "e" or "E":
        print('Canceling...')
        break
    else: 
        continue
metatoaster
  • 15,494
  • 5
  • 50
  • 57

0 Answers0