def int_check(question): """checks user enter an integer / foat that is more than zero""" error = "opps please enter an intger" while True: try: # changing the responce to an integer and check that it is more than 0 response = int(input(question)) return response except ValueError: print (error) #main loop goses here while True: print() name= input("name: ") age = int_check("Age: ") if age <12: print(f"{name} is too young") elif age >120: print(f"{name} is to old") else: print(f"{name} bought a ticket")