-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrock_paper_scissors.py
More file actions
32 lines (22 loc) · 990 Bytes
/
rock_paper_scissors.py
File metadata and controls
32 lines (22 loc) · 990 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
import random
print("Hello, welcome to Rock, Paper, Scissors!")
while True:
bot_list = ["Rock", "Paper", "Scissors"]
bot_choice = random.choice(bot_list).lower()
player_choice = input("What is your choice? (Rock/Paper/Scissors) ").lower()
if player_choice not in ["rock", "paper", "scissors"]:
print("Invalid choice. Please enter Rock, Paper, or Scissors.")
continue
print(f"Bot chose: {bot_choice.capitalize()}")
if bot_choice == player_choice:
print("🤝 It's a tie!")
elif (player_choice == "rock" and bot_choice == "scissors") or \
(player_choice == "paper" and bot_choice == "rock") or \
(player_choice == "scissors" and bot_choice == "paper"):
print("🏆 You win!")
else:
print("😞 You lose!")
start_again = input("\nWant to play again? (Yes/No) ").lower()
if start_again == "no":
print("Thanks for playing!")
break