-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrock_paper_scissors.py
50 lines (34 loc) · 1.48 KB
/
rock_paper_scissors.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
# This is the rock-paper-scissors game for two players
print("ROCK-PAPER-SCISSORS GAME \n")
user1 = input("First player: ")
user2 = input("Second player: ")
game_stat = True
while game_stat == True:
while user1 == user2:
print("SAME GUESS! Try again \n")
user1 = input("First player: ")
user2 = input("Second player: ")
if user1 == "rock" and user2 == "scissors":
print(f"Player 1 chose {user1} and beats Player 2 {user2}")
print("Player 1 is the WINNER!")
if user1 == "rock" and user2 == "paper":
print(f"Player 2 chose {user2} and beats Player 1 {user1}")
print("Player 2 is the WINNER!")
if user1 == "paper" and user2 == "rock":
print(f"Player 1 chose {user1} and beats Player 2 {user2}")
print("Player 1 is the WINNER!")
if user1 == "paper" and user2 == "scissors":
print(f"Player 2 chose {user2} and beats Player 1 {user1}")
print("Player 2 is the WINNER!")
if user1 == "scissors" and user2 == "paper":
print(f"Player 1 chose {user1} and beats Player 2 {user2}")
print("Player 1 is the WINNER!")
if user1 == "scissors" and user2 == "rock":
print(f"Player 2 chose {user2} and beats Player 1 {user1}")
print("Player 2 is the WINNER!")
user_game = input("Play again? (Type 'yes' or 'no')")
if user_game == "no":
game_stat = False
else:
user1 = input("First player: ")
user2 = input("Second player: ")