Rock Paper Scissors Game using Python

Coding Wall
CodingWall
Published in
2 min readFeb 26, 2023

Do you remember this game? Rock Paper Scissors — Most of us must have played this game in our childhood.

Rock Paper Scissors (also called Stone Paper Scissors) is a hand game usually played between two or more players. In this game, the players can choose from any of the options between Rock, Paper, or Scissors.

Game Rules:

  • Rock VS Paper — Paper Wins (As Paper can cover the Rock)
  • Rock VS Scissors — Rock Wins (As Rock can smash the Scissors)
  • Paper VS Scissors — Scissors Wins (As Scissors can cut the Paper)

Now, let’s create a simple game using Python to be played between two players.

choice1 = input('Select any option from \n Rock \n Paper \n Scissor \n\n')
choice2 = input('\nSelect any option from \n Rock \n Paper \n Scissor \n\n')

choice1=choice1.upper()
choice2=choice2.upper()

print("\nYou selected: \n", choice1, "\n", choice2, '\n')

if choice1=='ROCK' and choice2=='PAPER':
print("PAPER WINS!!!")
elif choice1=='ROCK' and choice2=='SCISSOR':
print("ROCK WINS!!!")
elif choice1=='PAPER' and choice2=='ROCK':
print("PAPER WINS!!!")
elif choice1=='PAPER' and choice2=='SCISSOR':
print("SCISSOR WINS!!!")
elif choice1=='SCISSOR' and choice2=='ROCK':
print("ROCK WINS!!!")
elif choice1=='SCISSOR' and choice2=='PAPER':
print("SCISSOR WINS!!!")
else:
print('Invalid Inputs Provided')

First, we will take input from the user on whether they want to select Rock, Paper, or Scissors. Then, I had chosen to convert the choices to uppercase.

Reason: rock or Rock or RoCK or there can be several other inputs that can be given by the user. So we can convert it into uppercase or lowercase, as per our preference

Now, the code will check the if-else conditions & print the relevant output.

There are many ways in which we can write Python code for this game. This is a very easy and beginner-friendly Python program using if-else conditions.

If this article was useful to you, share it to help others find it.

HAPPY LEARNING! HAPPY CODING!

--

--