-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock-Paper-Scissor.py
More file actions
63 lines (54 loc) · 1.13 KB
/
Copy pathRock-Paper-Scissor.py
File metadata and controls
63 lines (54 loc) · 1.13 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
#Write your code below this line 👇
import random
user_choice = input("choose 0 for Rock 1 for Paper and 2 for scissors: ")
CPU_choice=random.randint(0,2)
CPU_choice=str(CPU_choice)
print(f"User choose: {user_choice}")
print(f"CPU choose: {CPU_choice}")
if user_choice=='0':
print(rock)
elif user_choice=='1':
print(paper)
else:
print(scissors)
print("CPU choice: ")
if CPU_choice=='0':
print(rock)
elif CPU_choice=='1':
print(paper)
else:
print(scissors)
if user_choice == '0' and 'CPU_choice' == '2':
print("User Won")
elif user_choice == '2' and CPU_choice == '1':
print("User Won")
elif user_choice == '1' and CPU_choice == '0':
print("User Won")
elif user_choice == CPU_choice:
print("Draw")
else:
print("CPU Won")