• Предмет: Информатика
  • Автор: shormgg
  • Вопрос задан 5 месяцев назад

срочно!!!прошу 20балов ПИТОН!

Приложения:

Ответы

Ответ дал: hypefaq
1

1.
heroes = ["Harry Potter", "Bilbo Baggins", "Katniss Everdeen", "Sherlock Holmes", "Iron Man"]

actions = ["casting spells", "going on an adventure", "fighting in the arena", "solving a mystery", "saving the world"]

2.

import random

def generate_sentence():

   hero = random.choice(heroes)

   action = random.choice(actions)

   sentence = hero + " is " + action

   return sentence

3.
print(generate_sentence())

5.
for i in range(5):

   print(generate_sentence())

6.
i = 0

while i < 10:

   print(generate_sentence())

   i += 1


shormgg: брат ты супер спасибо
Вас заинтересует