-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday4.py
More file actions
46 lines (41 loc) · 893 Bytes
/
day4.py
File metadata and controls
46 lines (41 loc) · 893 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
42
43
44
45
46
import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
#Write your code below this line 👇
rpc = [rock,paper,scissors]
cpu_choice = random.randint(0,2)
my_choice = int(input("Choose Rock (0), Paper (1) or Scissors (2): "))
print(f"Your choice:\n{rpc[my_choice]}\nComputer choose:\n{rpc[cpu_choice]}")
if cpu_choice == my_choice:
print("Its a draw.")
else:
if cpu_choice == 0 and my_choice == 1:
print("You win.")
elif cpu_choice == 1 and my_choice == 2:
print("You win.")
elif cpu_choice == 2 and my_choice == 0:
print("You win.")
else:
print("You lose.")