Вопрос задан 17.06.2023 в 07:12. Предмет Информатика. Спрашивает Sheviwama Selatyra.

Домашняя работа «Арифметика строк» Задача 1 Два школьника записываются в баскетбольный кружок.

Они пишут на узком регистрационном листе свои имена и фамилии. В одной строке умещается только одно слово. Прочитай их записи и выведи их так, чтобы в каждой строке было имя и фамилия.
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Доджаев Давид.

Ответ:

Вася Сидоров

Ваня Петров

Вася Сидоров

Ваня Петров

Объяснение:

names = []

for i in range(4):

  names.append(input())

print("\n")

i = 0

while i < len(names):

  print(names[i], names[i + 1])

  i += 2

0 2
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

To solve this task, you need to read the names and surnames of the two students from the registration list and display them in a format where each line contains both the first name and the last name.

Here's an example of how you can achieve this in Python:

```python # Read the names and surnames from the registration list name1 = input("Enter the first student's name: ") surname1 = input("Enter the first student's surname: ") name2 = input("Enter the second student's name: ") surname2 = input("Enter the second student's surname: ")

# Display the names and surnames in the desired format print(f"{name1} {surname1}") print(f"{name2} {surname2}") ```

This code prompts the user to enter the names and surnames of the two students and then prints them in the desired format, with the first name followed by the last name on each line.

Please note that this is just one way to solve the problem, and there may be other approaches as well.

Let me know if you need any further assistance!

0 0

Похожие вопросы

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос