-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (35 loc) · 974 Bytes
/
main.py
File metadata and controls
41 lines (35 loc) · 974 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
41
import random
## The first thing destroyes the second thing
rules = { "Scissors": ["Paper", "Lizard"],
"Paper": ["Rock", "Spock"],
"Rock": ["Lizard", "Scissors"],
"Lizard": ["Spock", "Paper"],
"Spock" : ["Scissors", "Rock"],
}
options = [
'Rock',
'Paper',
'Scissors',
'Lizard',
'Spock'
]
restart = True
while restart == True:
restart = False
usrinput = input("What do you choose: ")
randompick = ','.join(random.choices(options))
if usrinput not in options:
print("Invalide Input")
restart = True
else:
print("You chose " + usrinput)
print('I choose ', randompick)
restart = False
if usrinput in ','.join(rules.get(randompick)):
print("You LOSE")
else:
if randompick == usrinput:
print("DRAW")
else:
print("You WIN")
restart = True