-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise045.py
More file actions
51 lines (45 loc) · 1017 Bytes
/
exercise045.py
File metadata and controls
51 lines (45 loc) · 1017 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
from random import randint
from time import sleep
items = ('Rock', 'Paper', 'Scissors')
computer = randint(0, 2)
print('''Your options:
[ 0 ] Rock
[ 1 ] Paper
[ 2 ] Scissors''')
player = int(input("What's your move? "))
print('JO')
sleep(1)
print('KEN')
sleep(1)
print('PO!!!')
print('-=' * 11)
print('Computer threw {}'.format(items[computer]))
print('You threw {}'.format(items[player]))
print('-=' * 11)
if computer == 0:
if player == 0:
print('DRAW')
elif player == 1:
print('YOU WON')
elif player == 2:
print('COMPUTER WON')
else:
print('Invalid Play!')
elif computer == 1:
if player == 0:
print('COMPUTER WON')
elif player == 1:
print('DRAW')
elif player == 2:
print('YOU WON')
else:
print('Invalid Play!')
elif computer == 2:
if player == 0:
print('YOU WON')
elif player == 1:
print('COMPUTER WON')
elif player == 2:
print('DRAW')
else:
print('Invalid Play!')