You are on page 1of 9

KENDRIYA VIDYALAYA

SANGATHAN NO.1

COMPUTER SCIENCE
INVESTIGATORY
PROJECT
CERTIFICATE
This is to certify that this group
studying in class 11(G)
Has successfully completed the
computer science investigatory
Project for the year 2023-24.
Group Student Name:
1. Ansh Pandey
2. Ayush Sharma
3.
4.

Mrs. Neha Chauhan


(PGT [Comp.sc])
ACKNOWLEDGEMENT
I would like to express a deep
sense of thanks and gratitude to
my computer science teacher
Mrs. Neha Chauhan for guiding
me immensely through the
course of my project. Her
advice and constant motivation
have been responsible for the
successful completion of my
project. I also thank my mates
for the completion of this
project
INTRODUCTION
The following program creates
a two player rock paper scissors
game with python
programming language. Some
rules of this game are:-
1. Rock beats scissors
2. Scissors beats paper
3. Paper beats rock
The game uses the simple
coding of Python programming
language.
CODE:-
user1 = input("What's your name?")
user2 = input("And your name?")
user1_answer = input("%s, do yo want to
choose rock, paper or scissors?" % user1)
user2_answer = input("%s, do you want
to choose rock, paper or scissors?" %
user2)

def compare(u1, u2):


if u1 == u2:
return("It's a tie!")
elif u1 == 'rock':
if u2 == 'scissors':
return("Rock wins!")
else:
return("Paper wins!")
elif u1 == 'scissors':
if u2 == 'paper':
return("Scissors win!")
else:
return("Rock wins!")
elif u1 == 'paper':
if u2 == 'rock':
return("Paper wins!")
else:
return("Scissors win!")
else:
return("Invalid input! You have not
entered rock, paper or scissors, try
again.")
sys.cont
print(compare(user1_answer,
user2_answer))
OUTPUT:-

You might also like