-
Notifications
You must be signed in to change notification settings - Fork 203
/
Copy pathRockPaperScissors
47 lines (46 loc) · 1.75 KB
/
RockPaperScissors
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
import random
Cchoice=["Rock","Paper","Scissor"]
while True:
print("Rock Paper Scissor Game:")
youwin,computerwin=0,0
for i in range(1,4):
print("Round",i,"Start:")
print("Please Select the Option:")
print("1.Rock","2.Paper","3.Scissor",sep="\n")
yourchoice=int(input())
if yourchoice==1:
print("You Choosen Rock")
yourchoice="Rock"
elif yourchoice==2:
print("You Choosen Paper")
yourchoice="Paper"
elif yourchoice==3:
print("You Choosen Scissor")
yourchoice="Scissor"
else:
print("Wrong Choose")
break
Computerchoice=random.choice(Cchoice)
print("Computer Choosen:",Computerchoice)
if yourchoice==Computerchoice:
print("This Round is Drawn:")
elif (yourchoice=="Paper" and Computerchoice=="Rock") or (yourchoice=="Rock" and Computerchoice=="Scissor") or (yourchoice=="Scissor" and Computerchoice=="Paper"):
youwin+= 1
print("You win this Round")
else:
computerwin+= 1
print("Computer win this Round")
if youwin>computerwin:
print("You win this Game:")
print("Score is:","Your Score:",youwin,"Computer Score:",computerwin,sep=" ")
elif computerwin>youwin:
print("Computer win this Game:")
print("Score is:","Your Score:",youwin,"Computer Score:",computerwin,sep=" ")
else:
print("Match Drawn")
print("Score is:","Your Score:",youwin,"Computer Score:",computerwin,sep=" ")
user_choice=input("Want to Play Again? (Yes/Exit)")
if user_choice=='yes' or user_choice=='Yes' or user_choice=='YES':
continue
else:
break