# Functions go here def int_check(question): """Checks users enter an integer""" error = "Oops - please enter an integer." while True: response = input(question).lower() # check for the exit code if response == "xxx": return response try: # Change the respoinse to an integre and check that its more than 0 response = int(response) return response except ValueError: print(error) # NMain routine goes here # loop fo testing purpose while True: print() # ask the user for their name name = input("Name: ") # replace with call to 'not vlank' function # ask their age and check if 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 young") continue else: print(f"{name} bought a ticket")