#Rock Paper Scissors


Rock Paper Scissors

This is a typical game of rock paper scissors coded using python.

# Rock Paper Scissors from random import randint loop = input("Do you want to play rock paper scissors? Enter yes or no: ") while loop != "no": number = randint(0, 2) plays = ["rock", "paper", "scissors"] opponent = plays[number] play = str(input("Type in either rock, paper or scissors: ")) if (play != "rock") and (play != "paper") and (play != "scissors"): print("You may have misspelled a word") elif play == opponent: print("Tie! ") elif opponent == "rock": if play == "scissors": print("You lose, rock beats scissors. ") elif play == "paper": print("You win, paper beats rock. ") elif opponent == "paper": if play == "rock": print("You lose, paper beats rock. ") elif play == "scissors": print("You win, scissors beats paper") elif opponent == "scissors": if play == "rock": print("You win, rock beats scissors") elif play == "paper": print("You lose, scissors beat paper") loop = input("Do you want to play again? Enter either yes or no: ") print("Thanks for playing!")
1