def int_check(question): """Checks users enter an integer""" error = "Oops - please enter an intger." while True: try: # Return the response if it's an integer response = int(input(question)) return response except ValueError: print(error)