import random random_1 = random.randint(1,12) random_2 = random.randint(5,15) correct_answer = random_1 * random_2 error = "please enter a valid answer" # main function while True: try: question_answer = int(input(f" {random_1} x {random_2} = ")) if question_answer == correct_answer: print("correct") else: print(f"incorrect and the correct answer is {correct_answer}") except ValueError: print(error) # right now this is the same as questions_v1.py