In: Computer Science
Modified from Chapter 07 Programming Exercise 5
Original Exercise:
Rock, Paper, Scissors Modification
Programming Exercise 11 in Chapter 6 asked you to design a program
that plays the Rock, Paper, Scissors game. In the program, the user
enters one of the three strings—"rock", "paper", or "scissors"—at
the keyboard. Add input validation (with a case-insensitive
comparison) to make sure the user enters one of those strings
only.
Modifications:
Turn IN:
Raptor flowchart file (or alternative flowchart
screenshot)
        If you are on Windows
please try using the built-in "Snip & Sketch" program to take a
perfectly sized screenshot.
Thonny Python file (or Python file is written in any
IDE/program)
        Turn in the actual
Python code file "file_name.py"

import random #import random for pc_choice
pc_choice_list = ["rock", "paper", "scissors"] #choices with computer
check = False #variable to check whether q has been pressed or not
while check == False:
    # loop will run until q is pressed
    pc_choice = random.choice(pc_choice_list) # randomly pc selecting its choice from the availabe options
    
    print("Let's Play Rock, Paper, Scissors")
    
    player = input("Input your choice: r,p, or s:")  #taking input
    
    player=player.lower() #making the input string lowercase 
    
    if player=="r":
        player="rock"
        # if r is entered by player then making it rock to compare it easily with pc_choice
    if player=="p":
        player="paper"
        # if p is entered by player then making it paper to compare it easily with pc_choice
    if player=="s":
        player="scissors"
        # if s is entered by player then making it scissors to compare it easily with pc_choice
    if player == pc_choice:
        print("Tie!")
        
    elif player == "rock":
        if pc_choice == "Paper":
            print("Lose!! paper beats rock")
        else:
            print("You win!! rock beats scissors")
            
    elif player == "paper":
        if pc_choice == "scissors":
            print("Lose!! Scissors beats Paper")
        else:
            print("You win!! Paper beats Rock")
            
    elif player == "scissors":
        if pc_choice == "rock":
            print("Lose!! Rock beats Scissors")
        else:
            print("You win!! Scissors beats Paper")
            
    elif player=="q":
        print("Game Over")
        check=True
        #if player enters q then check is true and condition in while loop becomes false so loop breaks
    else:
        print("That's not a valid play. Check your spelling!")
        #if not a valid string.
        
        
If you need any files or have any problem comment below.
Please upvote.
Cheers!!