-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPS.py
More file actions
32 lines (22 loc) · 746 Bytes
/
RPS.py
File metadata and controls
32 lines (22 loc) · 746 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
choices = ("rock", "paper", "scissor")
Playing = True
while Playing:
player = input("choose(rock,paper,scissor)")
machine = random.choice(choices)
if player == "quit":
break
if player !="rock" and player !="paper" and player !="scissor":
player = input("choose(rock,paper,scissor)")
print(f"player:{player}")
print(f"machine:{machine}")
if player == machine :
print("Tie")
elif player == "rock" and machine == "scissor" :
print("Player won")
elif player == "paper" and machine == "rock" :
print("Player won")
elif player == "paper" and machine == "rock" :
print("Player won")
else:
print("machine won")