# The first Python program #functions go here def yes_no(question): while True: response = input(question).lower() # check the user says yes / no if response == "yes" or response == "y": return "yes" elif response == "no" or response == "n": return "no" else: print("Please enter yes / no") #display instructions def instructions(): print(''' *** Instructions **** To begin, choose the number of rounds (or press infinite mode). Then play against the computer. You need to pick R (rock), P (paper) or S (scissors). The rules are as follows: - Paper beats Rock - Rock beats scissors - Scissors beats paper Good Luck! ''') def int_check(): error = 'Please enter an integer more than / equal to 13.' while True: try: response = int(input("What is the game goal? (13 or above) ")) if response < 13: print(error) else: return response except ValueError: print(error) #main routine print() print("Rock / Paper / Scissors Game") print() # ask the user if they want to see the instructions and display #them if requested want_instructions = yes_no("Do you want to see the instructions? ") #checks users enter yes (y) or no (n) if want_instructions == "yes": instructions() print() game_goal = int_check() print(game_goal)