forked from client69/Open
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StonePaperScissors.py
41 lines (37 loc) · 1.04 KB
/
StonePaperScissors.py
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
import random
temp1='y'
while temp1=='y':
print('Hi there, lets play')
print('Pick your choice: stone | paper | scissors')
user_choice = input()
options=['stone','paper','scissors']
print(f'You chose: {user_choice}')
computer_choice = random.choice(options)
print(f'Computer chose chose: {computer_choice}')
if user_choice in options:
if computer_choice == user_choice:
print('draw')
elif computer_choice=='stone':
if user_choice=='scissors':
print('compuer won!')
else:
print('You won!')
elif computer_choice=='scissors':
if user_choice=='paper':
print('compuer won!')
else:
print('You won!')
elif computer_choice=='paper':
if user_choice=='stone':
print('compuer won!')
else:
print('You won!')
else:
print('You made an invalid choice! ')
print('Do you want to play again? Y/N: ')
temp1=input().lower()
else:
if temp1=='n':
print('Thank you for joining')
else:
print('You made an invalid choice! ')