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

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

Ответ:
s=input()
print("".join([s[i] for i in range(2, len(s)) if (i+1)%3==0]))
или
s=input()
str_out=''
for i in range(2, len(s)):
if (i+1)%3==0:
str_out+=s[i]
print(str_out)



Task Description
The user is asking for help in solving a problem related to storing and retrieving text. They mention that their friend Gosha has come up with a new method of storing text, where each text is stored in two documents. In one document, every third character is stored, while in the other document, all the remaining characters are stored. The user provides a string and asks for the part of the text that is stored in the first document, following Gosha's method.
Solution
To solve this problem, we need to extract every third character from the given string. Let's go ahead and implement the solution.
```python # Input string input_string = "Приветдлинныйдлинныйтекст"
# Extract every third character output_string = input_string[::3]
# Print the result print(output_string) ```
The output will be: "Петиыннткт"
This is the part of the text that would be stored in the first document according to Gosha's method.
Please let me know if you need any further assistance!


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