-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRockPaperScissors.py
More file actions
46 lines (33 loc) · 832 Bytes
/
RockPaperScissors.py
File metadata and controls
46 lines (33 loc) · 832 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
#!/bin/python3
from random import randint
player = input('rock (r), paper (p), scissors (s)?')
if player == 'r':
print('''0 vs''', end = ' ')
elif player == 'p':
print('''___ vs ''', end = ' ')
else:
print('''>8 vs ''', end = ' ')
chosen = randint(1,3)
if chosen == 1:
computer = 'r'
print('0')
elif chosen == 2:
computer = 'p'
print('___')
else:
computer = 's'
print('>8')
if player == computer:
print('DRAW')
elif player == 'r' and computer == 's':
print('PLAYER WINS')
elif player == 'r' and computer == 'p':
print('COMPUTER WINS')
elif player == 'p' and computer == 'r':
print('PLAYER WINS')
elif player == 'p' and computer == 's':
print('COMPUTER WINS')
elif player == 's' and computer == 'p':
print('PLAYER WINS')
elif player == 's' and computer == 'r':
print('COMPUTER WINS')