
Петя решил нарисовать красивый узор в тетради. Сначала он нарисовал две строки одинаковой длины (в
обеих чётное количество символов), а потом повторил их столько раз, сколько символов в каждой строке. Даны первые две строки. Выведи весь узор. Ввод Вывод !--- ---! !--- ---! !--- ---! !--- ---! !--- ---!

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

a = input()
b = input()
for i in range(len(a)):
print(a)
print(b)



Problem Analysis
Petya wants to draw a beautiful pattern in his notebook. He starts by drawing two lines of equal length, each with an even number of characters. Then he repeats these lines as many times as there are characters in each line. We are given the first two lines and need to output the entire pattern.
Solution
To solve this problem, we can follow these steps:
1. Read the first two lines of the pattern. 2. Determine the length of each line. 3. Repeat each line as many times as there are characters in that line. 4. Output the entire pattern.
Let's implement this solution in code:
```python # Read the first two lines of the pattern line1 = input() line2 = input()
# Determine the length of each line length = len(line1)
# Repeat each line as many times as there are characters in that line pattern = (line1 + '\n') * length + (line2 + '\n') * length
# Output the entire pattern print(pattern) ```
Example
Input: ``` !---+---! !---+---! ```
Output: ``` !---+---! !---+---! !---+---! !---+---! !---+---! ```
Explanation
In this example, the first line is `!---+---!` and the second line is also `!---+---!`. Both lines have a length of 9 characters. Therefore, we repeat each line 9 times to get the entire pattern:
``` !---+---! !---+---! !---+---! !---+---! !---+---! ```
Note: The example provided in the question is incomplete, as it does not specify the length of the lines. However, we can assume that both lines have the same length, as mentioned in the problem statement.


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







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