-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rock,paper,scissors.py
35 lines (29 loc) · 1.03 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
#Rock, paper, scissors
import random
while True:
user_input = input("Rock, paper, scissors? ")
hands = ["Rock", "Paper", "Scissors"]
random.hand = random.choice(hands)
if user_input == random.hand:
print("It's a tie!")
elif user_input == "Rock":
if random.hand == "Paper":
print("You lose!", random.hand, "covers", user_input)
else:
print("You win!", user_input, "smashes", random.hand)
if user_input == "Paper":
if random.hand == "Scissors":
print("You lose!", random.hand, "cut", user_input)
else:
print("You win!", user_input, "covers", random.hand)
if user_input == "Scissors":
if random.hand == "Rock":
print("You lose...", random.hand, "smashes", user_input)
else:
print("You win!", user_input, "cut", random.hand)
play_again = input("Play again? Y/N ")
if play_again == "Y" or "y":
print("Let's play!")
else:
print("Thanks for playing!")
break