import random error = "Please enter an integer that is 1 or more" while True: try: count = int(input("How many questions do you want? ")) question_number = int(input("how many questions would you like? ")) if question_number < 1: print(error) else: while count >= 1: try: count -= 1 random_1 = random.randint(2, 15) random_2 = random.randint(2, 15) answer = int(random_1 * random_2) player_ans = int(input(f"{random_1} X {random_2} = ")) print(f"{count} questions left") if answer == player_ans: print("Correct") else: print(f"Incorrect, answer was {answer}") except ValueError as error: print(error)