Pc Piedra — Papel Y Tijeras.txt
import random def play_game(): options = ["rock", "paper", "scissors"] print("--- Welcome to Rock, Paper, Scissors! ---") user_choice = input("Enter your choice (rock, paper, or scissors): ").lower() if user_choice not in options: print("Invalid choice. Please try again.") return computer_choice = random.choice(options) print(f"Computer chose: {computer_choice}") if user_choice == computer_choice: print("It's a tie!") elif (user_choice == "rock" and computer_choice == "scissors") or \ (user_choice == "paper" and computer_choice == "rock") or \ (user_choice == "scissors" and computer_choice == "paper"): print("Congratulations! You win!") else: print("You lose! Better luck next time.") if __name__ == "__main__": play_game() Use code with caution. Copied to clipboard Key Logic Features
: The code converts your input to lowercase so it works even if you type "Rock" or "ROCK". PC PIEDRA PAPEL Y TIJERAS.txt
You can copy this into a .py file or a text editor to run it: import random def play_game(): options = ["rock", "paper",