def int_check(question): while True: error = "Enter an integer more than 1" try: response = int(input(question)) # check the number is more than 1 if response >= 1: return response else: print(error) except ValueError: print(error) def rounds_check(question): while True: error = "Enter an integer between 5 to 15" rounds = int_check(question) if 5 <= rounds <= 15: print(f"{rounds} proceeding") break else: print(error) rounds = rounds_check("how many rounds you would like to play")