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

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

Ответ:
Вася Сидоров
Ваня Петров
Вася Сидоров
Ваня Петров
Объяснение:
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



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!


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







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili