-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rock-Paper-Scissors-Game.py
48 lines (42 loc) · 1.32 KB
/
Rock-Paper-Scissors-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
import random
while True:
chos = ["rock", "paper", "scissors"]
comp = random.choice(chos)
player = None
while player not in chos:
player = input("Rock, Paper, Scissors? :").lower()
if player == comp:
print("Computer:", comp)
print("Player:", player)
print("Tie!")
elif player == "rock":
if comp == "paper":
print("Computer:", comp)
print("Player:", player)
print("You Lose!")
elif comp == "scissors":
print("Computer:", comp)
print("Player:", player)
print("You win!")
elif player == "scissors":
if comp == "rock":
print("Computer:", comp)
print("Player:", player)
print("You Lose!")
elif comp == "paper":
print("Computer:", comp)
print("Player:", player)
print("You win!")
elif player == "paper":
if comp == "scissors":
print("Computer:", comp)
print("Player:", player)
print("You Lose!")
elif comp == "rock":
print("Computer:", comp)
print("Player:", player)
print("You win!")
play_again = input("Play again? (yes/no) : ").lower()
if play_again != "yes":
break
print("Bye, thanks for playing the game!")