Rock Paper Scissors
Code Speed : 1s
Play The Game
Your Choice:
Computer's Choice:
Choose One:
Rock
Paper
Scissors
See the Code
0: def play_round(player_choice):
1: choices = ["rock", "paper", "scissors"]
2: computer_choice = random.choice(choices)
3: if player_choice == computer_choice:
4: return "It's a tie!"
5: elif (player_choice == "rock" and computer_choice == "scissors"):
6: return "You win!"
7: elif (player_choice == "scissors" and computer_choice == "paper"):
8: return "You win!"
9: elif (player_choice == "paper" and computer_choice == "rock"):
10: return "You win!"
11: else return "You lose!"
Click the light bulb icon to learn what the line of code does!