-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrockpaperscissors.py
More file actions
56 lines (52 loc) · 1005 Bytes
/
Copy pathrockpaperscissors.py
File metadata and controls
56 lines (52 loc) · 1005 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
47
48
49
50
51
52
53
54
55
56
import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
user=int(input("What do you wanna choose - Type 1 for Rock,2 for Paper and 3 for Scissors : "))
rcs=[rock,paper,scissors]
rcsrandom=random.randint(0,len(rcs)-1)
computer=rcs[rcsrandom]
print("You have chosen : \n"+ rcs[user-1])
print("Computer has chosen : \n"+ computer)
if user==1:
if rcsrandom==0:
print("Its a tie")
elif rcsrandom==1:
print("You lost")
else:
print("You won")
elif user==2:
if rcsrandom==0:
print("You won")
elif rcsrandom==1:
print("Its a tie")
else:
print("You lost")
else:
if rcsrandom==0:
print("You lost")
elif rcsrandom==1:
print("You won")
else:
print("Its a tie")