Информатика, вопрос задал kotdavid11 , 1 год назад

Створити програму-модель гри «Камінь – ножиці - папір»,

Ответы на вопрос

Ответил Sallil4210
0

Ответ:

import random

options=["rock", "scissors", "paper"]

player_choice=input("Choose one: rock, scissors or paper: ")

computer_choice=random.choice(options)

print("You choosed: "+player_choice)

print("Computer choosed: "+computer_choice)

if player_choice=="scissors":

   if computer_choice=="rock":

       print("You lose!")

   elif computer_choice=="paper":

       print("Congratulations! You won!")

   elif computer_choice=="scissors":

       print("Draw! Try again.")

if player_choice=="rock":

   if computer_choice=="rock":

       print("Draw! Try again.")

   elif computer_choice=="paper":

       print("You lose")

   elif computer_choice=="scissors":

       print("Congratulations! You won!")

if player_choice=="paper":

   if computer_choice=="rock":

       print("Congratulations! You won!")

   elif computer_choice=="paper":

       print("Draw! Try again.")

   elif computer_choice=="scissors":

       print("You lose!")    

Объяснение:

Можеш перекласти текст з англійської та переробити на свій смак. Вчителі теж можуть знайти цей сайт :)

Новые вопросы