-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPS
More file actions
45 lines (41 loc) · 1.42 KB
/
Copy pathRPS
File metadata and controls
45 lines (41 loc) · 1.42 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
41
42
43
44
'''Julia Marden
9/5/17
CMPT100
My first program'''
import random
from builtins import input
name=input('Hi, what is your name? ')
assert isinstance(name, str )
print ()
if name == 'Julia' or name == 'Marymelon':
print('Welcome to the monkey house')
elif name == 'Keefer':
print('Goodbye, blue Monday')
print('Hello', name)
abc=input('Would you like to play Rock, Paper, Scissors?(Y/N) ')
if abc == 'Y':
player=input('Great, you go first ')
if player == 'rock' or player == 'paper' or player == 'scissors':
computer_choice = random.choice(['rock', 'paper','scissors'])
print('I chose' , computer_choice, 'and you chose', player)
if player == computer_choice :
print('We tied!')
elif player == 'rock':
if computer_choice == 'paper':
print('I win,', computer_choice, 'covers', player)
else:
print('You win,', player,'smashes', computer_choice)
elif player == 'paper':
if computer_choice == 'scissors':
print('I win,', computer_choice, 'cuts', player)
else:
print('You win,', player,'covers', computer_choice)
elif player == 'scissors':
if computer_choice == 'rock':
print('I win,', computer_choice, 'smashes', player)
else:
print('You win,', player,'cuts', computer_choice)
elif abc == 'N':
print('I do not like what you got')
else:
print("I can't hear you")