-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrock_paper_scissor.py
48 lines (35 loc) · 1.16 KB
/
rock_paper_scissor.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
48
import random
while True:
comp_lists = ['Rock', 'Paper', 'Scissor']
user = input("WELCOME, please choose an option:").capitalize()
if user in comp_lists:
pass
else:
print("wrong input")
continue
comp = random.choice(comp_lists)
print(f"you choose {user}")
print(f"computer choose {comp} \n")
if user == "Rock" and comp == "Scissor":
print("YOU WIN")
elif user == "Rock" and comp == "Paper":
print("COMPUTER WINS")
elif user == "Rock" and comp == "Rock":
print("IT\'S A DRAW")
if user == "Paper" and comp == "Rock":
print("YOU WIN")
elif user == "Paper" and comp == "Scissor":
print("COMPUTER WINS")
elif user == "Paper" and comp == "Paper":
print("IT\'S A DRAW")
if user == "Scissor" and comp == "Paper":
print("YOU WIN")
elif user == "Scissor" and comp == "Rock":
print("COMPUTER WINS")
elif user == "Scissor" and comp == "Scissor":
print("IT\'S A DRAW")
repeat = input("Do you want to continue?(Y/N)").capitalize()
if "Y" in repeat:
continue
else:
exit()