Python Portal
Всё самое интересное из мира Python Сотрудничество, реклама: @devmangx Менеджер: @Spiral_Yuri РКН: https://clck.ru/3GMMF6
Show more📈 Analytical overview of Telegram channel Python Portal
Channel Python Portal (@pythonportal) in the Russian language segment is an active participant. Currently, the community unites 50 997 subscribers, ranking 2 534 in the Technologies & Applications category and 12 038 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 50 997 subscribers.
According to the latest data from 26 August, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -366 over the last 30 days and by -22 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 9.44%. Within the first 24 hours after publication, content typically collects 4.76% reactions from the total number of subscribers.
- Post reach: On average, each post receives 4 818 views. Within the first day, a publication typically gains 2 430 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 19.
- Thematic interests: Content is focused on key topics such as строка, none, true, модуль, peter.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Всё самое интересное из мира Python
Сотрудничество, реклама: @devmangx
Менеджер: @Spiral_Yuri
РКН: https://clck.ru/3GMMF6”
Thanks to the high frequency of updates (latest data received on 27 August, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
re
Основные функции модуля re:
🔸re.match(): Проверяет, соответствует ли начало строки заданному шаблону.
🔸re.search(): Ищет шаблон в строке и возвращает первый найденный совпадающий объект.
🔸re.findall(): Находит все совпадения шаблона в строке и возвращает их в виде списка.
🔸re.finditer(): Находит все совпадения шаблона и возвращает их в виде итератора.
🔸re.sub(): Заменяет все совпадения шаблона на заданную строку.
🔸re.split(): Разделяет строку по заданному шаблону.
Примеры использования:
import re
# Пример строки
text = "The rain in Spain falls mainly in the plain."
# 1. re.match()
match = re.match(r'The', text)
if match:
print("Match found:", match.group())
else:
print("No match found")
# 2. re.search()
search = re.search(r'rain', text)
if search:
print("Search found:", search.group())
else:
print("No search found")
# 3. re.findall()
findall = re.findall(r'in', text)
print("Findall results:", findall)
# 4. re.finditer()
finditer = re.finditer(r'in', text)
for match in finditer:
print("Finditer match:", match.group(), "at position", match.start())
# 5. re.sub()
substitute = re.sub(r'rain', 'snow', text)
print("Substitute result:", substitute)
# 6. re.split()
split = re.split(r'\s', text)
print("Split result:", split)
Объяснение примера:
> re.match(r'The', text): Проверяет, начинается ли строка text с "The".
> re.search(r'rain', text): Ищет первое вхождение "rain" в строке text.
> re.findall(r'in', text): Находит все вхождения "in" в строке text.
> re.finditer(r'in', text): Возвращает итератор, который перебирает все вхождения "in" в строке text.
> re.sub(r'rain', 'snow', text): Заменяет все вхождения "rain" на "snow" в строке text.
> re.split(r'\s', text): Разделяет строку text по пробелам (символы пробела).
Дополнительные примеры шаблонов:
\d: Любая цифра.
\D: Любой символ, кроме цифры.
\w: Любая буква, цифра или символ подчеркивания.
\W: Любой символ, кроме буквы, цифры или символа подчеркивания.
\s: Любой пробельный символ.
\S: Любой непробельный символ.
.: Любой символ, кроме новой строки.
^: Начало строки.
$: Конец строки.
*: 0 или более повторений.
+: 1 или более повторений.
?: 0 или 1 повторение.
{n}: Ровно n повторений.
{n,}: n или более повторений.
{n,m}: От n до m повторений.
Регулярные выражения мощный инструмент для работы с текстом, и они могут быть полезны в самых разных задачах, от простой проверки ввода до сложного парсинга текста. 💊
👉 @PythonPortal'A' if s>=90 else 'B' if s>=80 else 'C' if s>=70 else 'F'То, что это можно написать, ещё не значит, что так стоит писать. Если условий 3 и больше — лучше использовать
if-elif-else.
А тернарный оператор стоит оставить для:
comprehensions (генераторов списков / коллекций), lambda-выражений, return в одну строку.
👉 @PythonPortalPerson есть (has-a) name. У Car есть (has-a) color.
2/ is-a («наследование»). Один класс является разновидностью уже существующего. Employee — это (is-a) Person. Car — это (is-a) Vehicle.
👉 @PythonPortal"Non-even numbers not allowed", а сам список остаётся без изменений.
👉 @PythonPortal