-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrock_paper_scissors.py
More file actions
48 lines (39 loc) · 1.09 KB
/
Copy pathrock_paper_scissors.py
File metadata and controls
48 lines (39 loc) · 1.09 KB
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
#rock paper scissors
import random
from secrets import choice
choice=["rock","paper","scissor"]
computer=random.choice(choice)
player=None
while player not in choice:
player=input("rock , paper , scissor: ?").lower()
if player==computer:
print("player:",player)
print("computer:",computer)
print("Tie")
elif player=="rock":
if computer=="paper":
print("player:",player)
print("computer:",computer)
print("You Lose")
if computer=="scissor":
print("player:",player)
print("computer:",computer)
print("You Win")
elif player=="paper":
if computer=="scissor":
print("player:",player)
print("computer:",computer)
print("You Lose")
if computer=="rock":
print("player:",player)
print("computer:",computer)
print("You Win")
elif player=="scissor":
if computer=="paper":
print("player:",player)
print("computer:",computer)
print("You Win")
if computer=="rock":
print("player:",player)
print("computer:",computer)
print("You Lose")