# This program is improved from V2 by passing another parameter to the in_check function (question) # functions go here def int_check(question, low, high): """Checks if users intger input is less or equal to 13.""" error = f"please input and integer (whole number) less than/equal to {low} and {high}. " while True: try: response = int(input(question)) if response <= high and response >= low: return response else: print(error) except ValueError: print(error) # main routine starts here game_goal = int_check('What is the game goal?', 1, 10) second_goal = int_check('What is the second game goal?', 5, 20) print(f" First goal is {game_goal} second goal is {second_goal}")