-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrps.py
34 lines (25 loc) · 894 Bytes
/
rps.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
import random
actions = ["rock","paper","scissors"]
while True:
user_action = input("Enter a Choice(rock, paper, scissors) or exit to exit game :")
computer_action = random.choice(actions)
print("User : " + user_action + " Copmuter : " + computer_action)
if user_action == computer_action:
print("Its a Draw!")
elif user_action == "rock":
if computer_action == "paper":
print("You Lose :(")
else : print ("You Win!!")
elif user_action == "paper":
if computer_action == "scissors":
print("You Lose :(")
else : print ("You Win!!")
elif user_action == "scissors":
if computer_action == "rock":
print("You Lose :(")
else : print ("You Win!!")
elif user_action == "exit":
print("BYE!!!")
exit()
else:
print("Invalid Input")