# checks for an integer between high and low def int_checker(question, low, high): while True: error = f"Please enter an integer that is between {low} and {high}." to_check = input(question) try: response = int(to_check) # checks that the number is equal or more if low <= response <= high: return response else: print(error) except ValueError: print(error) num_rounds = int_checker("How many rounds would you like to play (between 5 and 20)? ", 5, 20) print(f"You chose, {num_rounds}")