# functions go here def yes_no(question): """Checks user response to a question is yes / no (y/n), returns 'yes' or "no" """ while True: response = input(question).lower() # check the user says yes/ no / y / n if response == "yes" or response == "y": return "yes" elif response == "no" or response == "n": return "no" else: print("please enter yes / no") # Display the instructions if the user wants to see them def instructions(): """prints instructions""" print(""" *** Instructions **** To begin, choose the number of rounds (or press for infinite mode). Then play against the computer. You need to choose R (rock), P (paper), or S (scissors). The rules are as follows: o Paper beats rock o Rock beats scissors o Scissors beats paper Good Luck! """) # Main routine print() print(" Rock / Paper / Scissors Game ") print() # ask user if they want to see the instructions # If they requested want_instructions = yes_no("Do you want to read the instructions? ") # checks users enter yes (y) or no (n) if want_instructions == "yes": instructions() print('program continues')