forked from priyanshu-bhatt/Hactoberfest2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snake_water_gun_game.py
47 lines (43 loc) · 1.71 KB
/
snake_water_gun_game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Snake water gun
# Create a snake water gun game in Python! Search Snake water gun game in google if you need help on rules and how to play the game!
import random
i = 1
tie = 0
youwin = 0
comwin = 0
while i<=10:
print("Choose one of the following: ")
print("1. snake\n2. water\n3. gun")
inp = input()
com = random.choice(['snake', 'water', 'gun'])
if inp == com:
print(f"You choose: {inp} and Computer choose: {com}")
print(f"Game Tie, Round {i}")
tie += 1
else:
if inp == "snake" and com == "water":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Win, Round {i}")
youwin += 1
elif inp == "snake" and com == "gun":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Lose, Round {i}")
comwin += 1
elif inp == "water" and com == "snake":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Win, Round {i}")
youwin += 1
elif inp == "water" and com == "gun":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Win, Round {i}")
youwin += 1
elif inp == "gun" and com == "snake":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Win, Round {i}")
youwin += 1
elif inp == "gun" and com == "water":
print(f"You choose: {inp} and Computer choose: {com}")
print(f"You Lose, Round {i}")
comwin += 1
i += 1
print(f"You win: {youwin} rounds, Computer win: {comwin} rounds and tie rounds: {tie} ")