In [ ]:
import random #loads module

print ("Welcome to RPS!") #prints a welcome message

choices = ["rock", "paper", "scissors"] #your choices

player_score = 0 #keeps track of player score

computer_score = 0 #keeps track of computer score

while True: #loops program
    
    player_choice = input("please pick rock, paper or scissors:") #tells the player what choices they have
    
    if player_choice not in choices: #if player didnt pick any of the 3 options
        
        print("invalid, please put in one of the three choices") #prints what they did wrong
        
        continue #continues to the program
        
    computer_choice = random.choice(choices) #tells the computer to pick a choice randomly
    
    print ("the computer chose... {computer_choice}") #prints the computers final choice
    
    if player_choice == computer_choice: #if the player chose the same answer as the computer...
        
        print("TIE!") #prints TIE!
        
    elif (player_choice == "rock" and computer_choice == "scissors") or (player_choice == "paper" and computer_choice == "rock") or (player_choice == "scissors"  and  computer_choice == "paper"): #the possible outcomes
        print ("YOU WIN!") #prints YOU WIN!
        
        player_score += 1 #adds player score
        
    else:
        print("YOU LOST!") #prints YOU LOST!
        
        computer_score += 1 #adds computer score
        
    print("your score: {player_score}, Computer score: {computer_score}") #puts score side by side
play infinitely
please pick rock, paper or scissors:rock
the computer chose... {computer_choice}
YOU WIN!
your score: {player_score}, Computer score: {computer_score}
please pick rock, paper or scissors:paper
the computer chose... {computer_choice}
YOU WIN!
your score: {player_score}, Computer score: {computer_score}
please pick rock, paper or scissors:scissors
the computer chose... {computer_choice}
YOU LOST!
your score: {player_score}, Computer score: {computer_score}
In [ ]:
 
In [ ]: