-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.py
57 lines (43 loc) · 1.57 KB
/
game.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
import random
"""
welcome to my stone-paperf-scissor game made of python language
Programmer: Shuvasis
language: Python
Email: scorpion004ss@gmail.com
"""
total_input_left=10
no_of_computer_win=0
no_of_human_win=0
print("\t \t \t r = Rock : p = Paper : s = Scissor (....Enter Q to stop) \n")
while (total_input_left>0):
print(f"\n[ Your chance left {total_input_left} ]")
total_input_left-=1
human_input = input("Enter Your Choice....... \n")
human_input=human_input.lower()
computer_input = (random.choice(["s","p","k"]))
if human_input=="q":
print(".........GAME END.........")
break
elif human_input == computer_input:
print("Both are same !!!!!")
elif human_input == 'r' and computer_input == 'p':
print("Computer won.....You lose....!!")
no_of_computer_win+=1
elif human_input == 'p' and computer_input == 'r':
print("You Won !!")
no_of_human_win+=1
elif human_input == 'r' and computer_input == 's':
print("You Won !!")
no_of_human_win+=1
elif human_input == 's' and computer_input == 'r':
print("Computer won.....You lose....!!")
no_of_computer_win+=1
elif human_input == 's' and computer_input == 'p':
print("You Won !!")
no_of_human_win+=1
elif human_input == 'p' and computer_input == 's':
print("Computer won.....You lose....!!")
no_of_computer_win+=1
else:
print("You Entered Wrong input....try again")
print(f"\nComputer score {no_of_computer_win}\n Your score {no_of_human_win}")