-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock,Paper, Scissors.py
More file actions
32 lines (24 loc) · 865 Bytes
/
Copy pathRock,Paper, Scissors.py
File metadata and controls
32 lines (24 loc) · 865 Bytes
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
import random
options = ("rock","paper","scissors")
running = True
while running:
player = None
computer = random.choice(options)
while player not in options:
player = input("Enter a choice(rock,paper,scissors):")
print(f"player:{player}")
print(f"computer:{computer}")
if player == computer:
print("It is a TIE!")
elif player == "rock" and computer == "scissors":
print("You WIN!")
elif player == "paper" and computer == "rock":
print("You WIN!")
elif player == "scissors" and computer == "paper":
print("You WIN!")
else:
print("You LOSE!")
k = input("Play again? (y/n):")
if (k.lower() != "y"):
running = False
print("Thanks For Playing!")