-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython code
More file actions
67 lines (26 loc) · 972 Bytes
/
python code
File metadata and controls
67 lines (26 loc) · 972 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import random
emoji={"r":"🪨","p":"📃","s":"✂️"}
#general choices
choices=("r","p","s")
while(True):
#invalid input
user_choice=input(" rock / paper / scissor? (r/p/s): ").lower()
computer_choice=random.choice(choices)
if user_choice not in choices :
print(" !!! Invalid !!! ")
print(" please enter valid choice ")
continue
print(f' you chose {emoji[user_choice] } ')
print(f' computer chose {emoji[computer_choice] } ')
if user_choice==computer_choice:
print("TIES !")
elif(
(user_choice=="r"and computer_choice=="s") or
(user_choice=="p"and computer_choice=="r") or
(user_choice=="s"and computer_choice=="p")):
print(" ~~🎉YOU WON💕~~ ")
else:
print ("💀 YOU LOST 💀 ")
want_to_continue=input("Play again ❤️ \n Continue ( y or n ): ").lower()
if want_to_continue=="n":
break