forked from Romi904/Durmello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstone_paper_sessior.py
74 lines (70 loc) · 2.48 KB
/
stone_paper_sessior.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import random
game=1
total=10
ty=0
win=0
loss=0
print("======================================================")
print(" ")
print("= Welcome to Sonu,s [ Rock Paper Scissor] Game. =\n")
print(f"Toatal match is {total}")
print(" Ready to play with computer.\n")
while game<=total:
# R for rock , p for papper and X for sessior.
comp =["Rock","Paper","Scissor"]
comp_ans= random.choice(comp)
print("Enter [ R for Rock ][ P for Papper ][ X for Scissor]")
ans = input("==> ")
ans = ans.upper()
if(ans=='R'):
print("Your choice is: Rock")
if (ans=='R' and comp_ans=='Scissor'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== YOU WIN ======")
win+=1
elif(ans=='S' and comp_ans=='Stone'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== TY ======")
ty+=1
elif(ans=='S' and comp_ans=='Paper'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== You LOSS ======")
loss+=1
elif(ans=='P'):
print("Your choice is: Paper")
if (ans=='P' and comp_ans=='Scissor'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== YOU LOSS ======")
loss+=1
elif(ans=='P' and comp_ans=='Stone'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== YOU WIN ======")
win+=1
elif(ans=='P' and comp_ans=='Paper'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== TY ======")
ty+=1
elif(ans=='X'):
print("Your choice is: Scissor")
if (ans=='X' and comp_ans=='Scissor'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== TY ======")
ty+=1
elif(ans=='X' and comp_ans=='Stone'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== YOU LOSS ======")
loss+=1
elif(ans=='X' and comp_ans=='Paper'):
print(f"Computer's choice is: {comp_ans}\n")
print("====== YOU WIN ======")
win+=1
else:
print("Invalid Imput!")
print(f"Game counter {game}")
print("-------------------------------------------")
game+=1
print(f"""
Total match: {total}
You Win: {win}
You loss: {loss}
Ty match: {ty}""")