how do I break infinite while loop with user input
问题 I'm very new to Python. I made a math program that keeps generating a new math problem every time you get the last one right. however I don't know how to exit/break the while True loop and switch from addition to subtraction. import random while True: question = input("press 1 for addition, press 2 for subtraction.") if question == "1": print("Try your skill at these problems.") number1 = random.randint(0, 9) number2 = random.randint(0, 9) while True: print(number1, "+", number2, "=") number3