# Functions go here def int_check(question, low, high): """Checks users enter an integer / float that is more than zero (or the 'xxx' exit code)""" error = f"Oops - please enter a number between {low} and {high}." while True: try: # Change the response to an integer and check that it's more than zero response = int(input(question)) if low <= response <= high: return response else: print(error) except ValueError: print(error)