-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstone_paper_scissor.py
49 lines (42 loc) · 1.18 KB
/
stone_paper_scissor.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
import random
player=""
user=input("Your turn 1.Stone(s) 2.Paper(p) 3.Scissor(c):")
print("coputers turn 1.Stone 2.Paper 3.Scissor")
if user=="s":
player="Stone"
elif user=="p":
player="Paper"
elif user=="c":
player="scissor"
a=random.randint(1,3)
if a==1:
comp="stone"
elif a==2:
comp="paper"
else:
comp="scissor"
print(f"{player} vs {comp} ")
def win(user, comp):
if(user=="s"and comp=="scissor"):
print("You are win!✨✨")
elif(user=="c"and comp=="paper"):
print("You are win!🎉🎉")
elif(user=="p"and comp=="stone"):
print("You are win😎✌")
def loose(user,comp):
if(user=="p"and comp=="scissor"):
print("You loose😢")
elif(user=="s"and comp=="paper"):
print("You loose 🤦♂️")
elif(user=="c"and comp=="stone"):
print("You loose 🤷♀️")
def tie(user,comp):
if(user=="c"and comp=="scissor"):
print("Match is tie😒")
elif(user=="p"and comp=="paper"):
print("Match is tie😒")
elif(user=="s"and comp=="stone"):
print("Match is tie😒")
win(user,comp)
loose(user,comp)
tie(user,comp)