-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock_Paper_Scissors.py
More file actions
30 lines (26 loc) · 984 Bytes
/
Rock_Paper_Scissors.py
File metadata and controls
30 lines (26 loc) · 984 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
# 1 - Rock
# (-1) Paper
# 0 for Scissors
import random
#For getting random number from 1,-1,0 we use random
computer = random.choice([1, -1, 0])
yougive = input("Enter you Choise: ")
youDict = {"r":1,"s": 0 , "p": -1}
revDict = {1:"Rock",-1:"Paper",0:"Scissors"}
you = youDict[yougive]
print(f"Your Choise: {revDict[you]}\nComputer's choise: {revDict[computer]}")
if computer==you:
print("Its A Drawn")
else:
if computer == 1 and you == 0:
print("You Lost!!\nYou are Dumb")
elif computer ==1 and you == -1:
print("You are Winner!!\nThats What winnner's do!!")
elif computer == -1 and you ==1:
print("You Lost!!\nYou are Dumb")
elif computer == -1 and you ==0:
print("You are Winner!!\nThats What winnner's do!!")
elif computer == 0 and you ==1:
print("You are Winner!!\nThats What winnner's do!!")
elif computer == 0 and you ==-1:
print("You Lost!!\nYou are Dumb")