Professional Documents
Culture Documents
“SNAKE
WATER
AND GUN
GAME
IN PYTHON”
Acknowledgement
The success and final outcome of this project required a lot of
guidance and assistance from few people and we are
extremely fortunate to have got this all along the completion of
our project work. Whatever we have done is only due to such
guidance and assistance and we would not forget to thank
them.
CERTIFICATE
The project recorded in the file has
LOGIC
This game involves two players.
In which one give input, i.e.
snake, water and gun and
computer guesses random among
snake, water and gun.
●If input is snake and computer
guesses gun then computer wins
and we lose or vice-versa.
●If input is water and computer
guesses gun then we won and
computer lose or vice-versa.
●If input is gun and computer
guesses gun then match tied.
FLOWCHART
START
PRINT INSTRUCTION
GENERTE RANDOM
CHOICE
IF
GUESS=
RANDOM PRINT “GAME
CHOICE TIED”
A B
B
A
IF GUESS
>RANDOM PRINT “YOU GETS
1 POINT”
CHOICE
IF GUESS PRINT
<RANDOM “COMPUTER
CHOICE GOT 1
POINT”
IF YOUR
POINTS >
COMPUTER
POINTS
PRINT YOU WIN!
if inp==ran:
print(f"you choose {inp} and computer
guess is {ran}")
print("Match Tied, Nobody gets point.\
n")
else:
print("invalid, Try again\n")
if attempts>7:
print("Game Over")
print(f"your point is {your_point} and
computer point is {computer_point}.")
if computer_point == your_point:
print("Match tied.")
if computer_point > your_point:
print("Computer won and you lost.")
if computer_point < your_point:
print("HURRAY! YOU WON")
Output - 1
▶Welcome to Snake, Water and Gun
game◀
Output - 2
▶Welcome to Snake, Water and Gun
game◀
TOPICS COVERED
IN THIS PROJECT
▹Import statements
▹While statements
▹if, else statements
▹Conditions
▹Comparison operators
▹Difference between
“=”and “==”
REFERENCES
1. NCERT of Class XI
Computer Science.