-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (28 loc) · 955 Bytes
/
main.py
File metadata and controls
40 lines (28 loc) · 955 Bytes
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
'''
1 for snake
-1 for water
0 for gun
'''
computer = 0
youstr = input("Enter your choice: ")
youDict = {"s" : 1 , "w" : -1, "g" : 0}
reverseDict = {1 : "snake", -1 : "water", 0 : "gun"}
you = youDict[youstr]
print(f"You chose {reverseDict[you]}\nComputer chose {reverseDict[computer]}")
if (computer == you):
print("it is draw")
else: #Nesting
if(computer == -1 and you == 1):
print("You win!")
elif(computer == -1 and you == 0):
print("You Lose!")
elif(computer == 1 and you == -1):
print("You Lose!")
elif(computer == 1 and you == 0):
print("You win!")
elif(computer == 0 and you == -1):
print("You win!")
elif(computer == 0 and you == 1):
print("You Lose!")
else:
print("somthing wantes wrong")