-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock_Paper_Scissors Game.py
More file actions
44 lines (34 loc) · 1.46 KB
/
Rock_Paper_Scissors Game.py
File metadata and controls
44 lines (34 loc) · 1.46 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
37
38
39
40
41
42
43
44
import random
print("---------------------------------------------------------")
print("~~~~~~ WELCOME TO PETASCO ROCK/PAPER/SCISSORS GAME ~~~~~")
print("~~~~~~~~~~~~~~~~ PLAY WITH PETASCO ~~~~~~~~~~~~~~~~~")
print("---------------------------------------------------------")
user_score = 0
petasco_score = 0
options = ["rock", "paper", "scissors"]
while True:
user_input = input("TYPE ROCK/PAPER/SCISSORS OR Q TO QUIT: ").lower()
if user_input == "q":
quit()
break
if user_input not in options:
continue
random_option = random.randint(0, 2)
petasco_pick = options[random_option]
print("Petasco Picks", petasco_pick + ".")
if user_input == "rock" and petasco_pick == "scissors":
print("<=**********=> CONGRATS! YOU WON! <=*****************=>")
user_score += 1
elif user_input == "paper" and petasco_pick == "rock":
print("<=**********=> CONGRATS! YOU WON! <=*****************=>")
user_score += 1
elif user_input == "scissors" and petasco_pick == "paper":
print("<=**********=> CONGRATS! YOU WON! <=*****************=>")
user_score += 1
else:
print("<=**********=> OOPs! YOU LOST! <=*****************=>")
petasco_score += 1
print("YOU WON ", user_score, "TIMES")
print("PETASCO WON", petasco_score, "TIMES")
print("<=*************-> PLAY AGAIN! <-************************=>")
print("--------- THANK YOU FOR PLAYING WITH PETASCO ------------")