-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript46_Lec12_Rock_Paper_Scissors.py
More file actions
40 lines (32 loc) · 1.1 KB
/
Script46_Lec12_Rock_Paper_Scissors.py
File metadata and controls
40 lines (32 loc) · 1.1 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
# In the name of God
# Mohammad Hossein Zehtab
# python-evens-17
# Lec 12: Rock, Paper, Scissors
import random
op = ['rock', 'paper', 'scissors']
while True:
userr = input('\nrock, paper, scissors? ')
print('............................................')
compp = random.choice(op)
print('You chose:', userr)
print('Computer chose:', compp)
if userr == compp:
print('\nTie!')
elif userr == 'rock' and compp == 'paper':
print('\nComputer Won')
elif userr == 'rock' and compp == 'scissors':
print('\nYou Won')
elif userr == 'paper' and compp == 'rock':
print('\nYou Won')
elif userr == 'paper' and compp == 'scissors':
print('\nComputer Won')
elif userr == 'scissors' and compp == 'rock':
print('\nComputer Won')
elif userr == 'scissors' and compp == 'paper':
print('\nYou Won')
else:
print('\nInvalid Input')
print('===========================================')
res = input('Play Again? (y/n): ')
if res != 'y':
break