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") # Displays instructions def 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: Paper beats rock Rock beats scissors Scissors beats paper Press to end the game at anytime. Good Luck! ''') #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 read the instructions? ") #checks users enter yes (y) or no (n) if want_instructions == "yes": instructions() print("Program continues")