-
Notifications
You must be signed in to change notification settings - Fork 0
/
rockPaperScissors.py
57 lines (41 loc) · 1.35 KB
/
rockPaperScissors.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
while True:
choices = ["rock", "paper", "scissors"]
bot = random.choice(choices)
player = None
while player not in choices:
player = input("rock, paper, or scissors: ").lower()
if player == bot:
print("bot: " + bot)
print("player: " + player)
print("it's a tie!")
elif player == "rock":
if bot == "paper":
print("bot: " + bot)
print("player: " + player)
print("You lost!")
if bot == "scissors":
print("bot: " + bot)
print("player: " + player)
print("you won!")
elif player == "paper":
if bot == "rock":
print("bot: " + bot)
print("player: " + player)
print("you won!")
if bot == "scissors":
print("bot: " + bot)
print("player: " + player)
print("you lost!")
elif player == "scissors":
if bot == "rock":
print("bot: " + bot)
print("player: " + player)
print("you lost!")
if bot == "paper":
print("bot: " + bot)
print("player: " + player)
print("you won!")
play_again = input("Do you want to play again? (yes/no) ").lower()
if play_again != "yes":
break