# Functions go here def int_check(question): """Checks users enter an integer / float that is more than zero (or the optional exit code)""" error = "Oops - please enter an integer more than zero." while True: try: # Return the response if it's an integer response = int(input(question)) return response except ValueError: print(error) # Main Routine # loop for testing while True: print() # ask user for their name name = input("Name: ") # replace with call to 'not blank' # ask for their age and check it's between 12 and 120 age = int_check("Age: ") # output error message / success message if age < 12: print(f"{name} is too young") continue elif age > 120: print(f"{name} is too old") continue else: print(f"{name} bought a ticket")