-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise8.py
46 lines (34 loc) · 1.33 KB
/
exercise8.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
#Make a two-player Rock-Paper-Scissors game.
# (Hint: Ask for player plays (using input), compare them,
# print out a message of congratulations to the winner,
# and ask if the players want to start a new game)
#Remember the rules:
#Rock beats scissors
#Scissors beats paper
#Paper beats rock
def paper_rock_scissor():
player_one = input("Player One : Please Input (Rock, Scissors, Paper) : ")
player_two = input("Player Two : Please Input (Rock, Scissors, Paper) : ")
if player_one == player_two :
print("It's Tie")
elif player_one == "Rock" and player_two =="Scissors":
print("Player One Win")
elif player_one == "Rock" and player_two =="Paper":
print("Player Two Win")
elif player_one == "Scissors" and player_two =="Paper":
print("Player One Win")
elif player_one == "Scissors" and player_two =="Rock":
print("Player Two Win")
elif player_one == "Paper" and player_two =="Scissors":
print("Player Two Win")
elif player_one == "Paper" and player_two =="Rock":
print("Player One Win")
else:
print("Wrong Format")
paper_rock_scissor()
play_again = input("Do You Want to Play Again (Y/N): ")
while play_again == "Y":
paper_rock_scissor()
play_again = input("Do You Want to Play Again (Y/N): ")
if play_again == "N":
break