-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
52 lines (43 loc) · 962 Bytes
/
main.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
50
51
52
import random
b='y'
while(b=='y'):
def gamewin(comp,you):
if comp==you:
return None
elif comp== 'st':
if you== 'p':
return True
else:
return False
elif comp== 'p':
if you== 'sc':
return True
else:
return False
else:
if you== 'st':
return True
else:
return False
print("Computer's turn: Stone(st), Paper(p), Scissor(sc)")
randon=random.randint(1,3)
if randon==1:
comp='st'
elif randon==2:
comp='p'
else:
comp='sc'
you = input("Your Turn: Stone(st), Paper(p), Scissor(sc)")
print("Computer chose: " +comp)
print("You chose: "+you)
a=gamewin(comp,you)
if a==None:
print("Match is draw!!:)")
elif a==True:
print("Hurray!! You win!!:D")
else:
print("Alas!You lose:(")
b=input("Do you want to play again(y/n)")
if(b=='n'):
print("Thanks for playing :D")
'break'