-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnake_water_gun.py
More file actions
28 lines (24 loc) · 1.04 KB
/
snake_water_gun.py
File metadata and controls
28 lines (24 loc) · 1.04 KB
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
print("Welcome to Snake_Water_Gun game!")
print("RULES:\n 1. SNAKE DRINKS WATER-SNAKE WINS \n 2. WATER RUSTS GUN-WATER WINS \n 3. GUN SHOOTS SNAKE-GUN WINS")
print("Choose : \n 's' for snake \n 'w' for water \n 'g' for gun")
import random
your_choice = input("ENTER YOUR CHOICE (s/w/g):").lower()
computer_choice = random.choice(['s','w','g'])
print(f"YOU CHOOSE : {your_choice} \nCOMPUTER CHOOSE:{computer_choice}")
if (computer_choice==your_choice):
print("MATCH IS A DRAW")
else:
if(computer_choice=="s" and your_choice=="w"):
print("Oops!you lose")
elif(computer_choice=="s" and your_choice=="g"):
print("Yeah! you win")
elif(computer_choice=="g" and your_choice=="w"):
print("Yeah! you win")
elif(computer_choice=="g" and your_choice=="s"):
print("Oops!you lose")
elif(computer_choice=="w" and your_choice=="g"):
print("Oops!you lose")
elif(computer_choice=="w" and your_choice=="s"):
print("Yeah! you win")
else:
print("something went wrong!!")