-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRockPaperScissors.py
More file actions
36 lines (22 loc) · 1.13 KB
/
RockPaperScissors.py
File metadata and controls
36 lines (22 loc) · 1.13 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
import random
running = True
while (running):
options = ("rock","paper","scissors")
computer = random.choice(options)
user = input("\nEnter your choice (rock,paper,scissors) : ").lower()
print(f"\nComputer's choice : {computer}")
print(f"Your choice : {user}")
if computer=="rock" and user=="paper" or computer=="scissors" and user=="rock" or computer=="paper" and user=="scissors":
print("\nYOU WON 🏆")
elif computer=="paper" and user=="rock" or computer=="rock" and user=="scissors" or computer=="scissors" and user=="paper":
print("\nYOU LOSE ❌")
elif computer=="rock" and user=="rock" or computer=="paper" and user=="paper" or computer=="scissors" and user=="scissors":
print("\nTIE 🤝")
else:
print(f'\nThere\'s no option of "{user}"!')
print("-------------------------------------------------")
play_again = input("Play Again ? (Y or N) : ").upper()
print("-------------------------------------------------")
if not play_again == "Y":
running = False
print("\nBye,Thanks for Playin'🙌🏼")