-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrock.py
47 lines (38 loc) · 1.48 KB
/
rock.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
import random
score_player1 = 0
score_player2 = 0
while True:
player1 = input("wanna play ? Rock/Paper/Scissor: ")
print(player1)
player2 = random.choice(["rock","paper","scissor"])
print(player2)
if player1 == player2:
print ("Try Again")
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "rock" and player2 == "paper":
print("player 2 as paper wins")
score_player2 += 1
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "rock" and player2 == "scissor":
print("player 1 as rock wins")
score_player1 += 1
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "paper" and player2 == "scissor":
print("player 2 as scissor wins")
score_player2 += 1
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "paper" and player2 == "rock":
print("player 1 as paper wins")
score_player1 += 1
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "scissor" and player2 == "rock":
print("player 2 as rock wins")
score_player2 += 1
print (f'Score : {score_player1}-{score_player2}')
elif player1 == "scissor" and player2 == "paper":
print("player 1 as scissor wins")
score_player1 += 1
print (f'Score : {score_player1}-{score_player2}')
else:
print("rock/paper/scissor only")
break