Coding of python a game of rock, paper, Scissor.
Автор: SMARTcodeLearning
Загружено: 2026-01-18
Просмотров: 4
here is the correct code of python:
import random
print("🎮 Welcome to Rock Paper Scissors Game 🎮")
choices = ["rock", "paper", "scissors"]
while True:
print("\nChoose one:")
print("1. Rock")
print("2. Paper")
print("3. Scissors")
user_choice = input("Enter your choice (rock/paper/scissors): ").lower()
if user_choice not in choices:
print("❌ Invalid choice! Please try again.")
continue
computer_choice = random.choice(choices)
print("🧑 You chose:", user_choice)
print("💻 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("🎉 You win!")
else:
print("😢 You lose!")
play_again = input("Do you want to play again? (yes/no): ").lower()
if play_again != "yes":
print("👋 Thanks for playing!")
break
you can write the come your device
thanks for watching 🙏🏻🙏🏻🙏🏻
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: