Alina Gentry's profile

Stone Paper Scissors Game in Python

Stone Paper Scissors Game in Python
The game of rock, paper, scissors is also referred to as stone, paper, scissors. Each player in this two-player hand game can make one of three forms out of their hand at random. The decision made by both players ties the game. Kids love playing the game rock, paper, scissors. We'll examine how this rock paper scissors game was developed using Python. Here's a simple implementation of the Stone-Paper-Scissors game in Python:

import random

choices = ["stone", "paper", "scissors"]

user_choice = input("Choose stone, paper, or scissors: ").lower()
computer_choice = random.choice(choices)

print(f"You chose {user_choice}. Computer chose {computer_choice}.")

if user_choice == computer_choice:
    print("It's a tie!")
elif (
    (user_choice == "stone" and computer_choice == "scissors")
    or (user_choice == "paper" and computer_choice == "stone")
    or (user_choice == "scissors" and computer_choice == "paper")
):
    print("You win!")
else:
    print("Computer wins!")
Stone Paper Scissors Game in Python
Published:

Stone Paper Scissors Game in Python

Published:

Creative Fields