def int_check(question): while True: error = "Please enter an integer that is 1 or more." to_check = input(question) if to_check == "": return "infinite" try: response = int(to_check) if response < 1: print(error) return "invalid" else: return response except ValueError: print(error) # Main Routine goes here # Initialise game variables mode = "regular" rounds_played = 0 print(" Rock / Paper / Scissors Game") print() # Instructions # Ask user for number of rounds / infinite mode num_rounds = int_check("How many rounds would you like? press for infinite mode: ") if num_rounds == "infinite": mode = "infinite" num_rounds = 5 # game loop starts here while rounds_played < num_rounds: if mode == "infinite": rounds_heading = f"\n Round {rounds_played + 1} (Infinite) Mode" else: rounds_heading = f"\n Round {rounds_played + 1} of {num_rounds}" print(rounds_heading) print() user_choice = input("Choose: ") if user_choice == "xxx": break rounds_played += 1 if mode == "infinite": num_rounds += 1 # game loop ends here # game history / statistic area