Coders Packet

Rock paper scissors in Python

By Shruti Solani

Play classic game rock paper scissors against a computer in Python. This program randomly selects one of rock, paper, scissors and asks the player to select one.

Rock paper scissors is a classic game for people of all ages. And when the game is against a machine, the challenge begins. 

Rock paper scissors game has simple rules :

1) Rock wins over scissors

2) Paper wins over rock

3) Scissors wins over rock

First, the computer selects one of the three tools. Then asks the player to select one tool. According to the rules, the winner is decided for each round. In the end, the number of games won by the player is displayed.

Technical details :

The random module is used for randomly selecting one tool. To install this module, type the command :

pip install random

All the best !!!

Download Complete Code

Comments

No comments yet