def string_checker(question, valid_ans=("yes", "no")): while True: user_response = input(question).lower() for item in valid_ans: if item == user_response: return item elif user_response == item[0]: return item def instructions(): """prints instructions""" print(""" *** Instructions *** To begin, choose the number of rounds (or infinite mode). Then play against the computer, with either R (rock), P (paper), or S (scissors). The rules are as follows: Paper beats rock Rock beats scissors Scissors beats paper Win the majority of rounds to win overall! """) #main routine print() print("Rock Paper Scissors Game!") print() #ask the user if they want to see the instructions want_instructions = string_checker("Do you want to see the instructions? ") #Display the instructions if the user responded with yes if want_instructions == 'yes': instructions() print() print("Program continues")