# checks for an integer that is in the range of low number and high number def int_check(question, low_number, high_number): while True: error = f"Please enter a number between {low_number} and {high_number}." try: response = int(input(question)) # checks that the number is more than or equal to the low number or less than or equal to the high number if response < low_number or response > high_number: print(error) else: return response except ValueError: print(error) # Automated testing is below in the form (test_case, expected_value) # run tests! rounds = int_check("Please enter the number of rounds: ",1, 10) print(f"Rounds: {rounds}") user_answer = int_check("what is 20 * 5: ",5, 100) if user_answer == 100: print(f"You got it!") else: print(f"You got it wrong. The correct answer is {user_answer}.")