-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstone_paper.py
More file actions
44 lines (32 loc) · 1.25 KB
/
stone_paper.py
File metadata and controls
44 lines (32 loc) · 1.25 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
print("WELCOME TO ROCK PAPER SCISSOR GAME!")
times=int(input("ENTER NUMBER OF TIMES YOU WANT TO PLAY:"))
print("========================================================\n\n")
chance=0
import random
import sys
while(chance<times):
alist=["ROCK","PAPER","SCISSOR"]
user_input=input("ENTER ROCK, PAPER or SCISSOR:").upper()
if(user_input in alist):
pass
else :
print("wrong input")
continue
computer=random.choice(alist)
print("YOUR CHOICE WAS:-> {}".format(user_input))
print("COMPUTER CHOSE :->{}".format(computer))
if(user_input==computer):
print('MATCH TIED!\n')
elif(user_input=="ROCK" and computer=="PAPER"):
print("COMPUTER WINS!\n")
elif(user_input=="ROCK" and computer=="SCISSOR"):
print("YOU WIN!\n")
elif(user_input=="SCISSOR" and computer=="ROCK"):
print("COMPUTER WINS!\n")
elif(user_input=="SCISSOR" and computer=="PAPER"):
print("YOU WIN!\n")
elif(user_input=="PAPER" and computer=="SCISSOR"):
print("COMPUTER WINS!\n")
elif(user_input=="PAPER" and computer=="ROCK"):
print("YOU WIN!\n")
chance=chance+1