TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #309 · 2 фев.

Метод строки split() разделяет строку на несколько строк по указанному символу >>> "a_b_c".split('_') ['a', 'b', 'c'] Можно указать максимальное количество разделений >>> "a_b_c".split('_', 1) ['a', 'b_c'] Или резать с другой стороны с помощью rsplit() (right split) >>> "a_b_c".rsplit('_', 1) ['a_b', 'c'] А что будет если оставить аргументы пустыми? >>> "a_b_c".split() ['a_b_c'] Получаем список с одним элементом, потому что по умолчанию используется пробельный символ. >>> "a b c".split() ['a', 'b', 'c'] То есть это равнозначно такому вызову? >>> "a b c".split(" ") ['a', 'b', 'c'] Кажется да, но нет! Давайте попробуем добавить пробелов между буквами >>> "a b c".split(" ") ['a', '', '', 'b', '', '', 'c'] И вот картина уже не так предсказуема 😕 А вот что будет по умолчанию >>> "a b c".split() ['a', 'b', 'c'] Всё снова красиво! 🤩 По умолчанию в качестве разделителя используется любой пробельный символ, будь то табуляция или новая строка. Включая несколько таких символов идущих подряд. А также игнорируются пробельные символы по краям строки. >>> "a\t b\n c ".split() ['a', 'b', 'c'] Аналогичный способ можно собрать с помощью регулярного выражения. Но пробелы по краям строки придется обрабатывать дополнительно. >>> import re >>> re.split(r"\s+", ' a b c '.strip()) ['a', 'b', 'c'] Здесь тоже можно указать количество разделений >>> re.split(r"\s+", 'a b c', 1) ['a', 'b c'] А что если мы хотим написать красиво, то есть split() без аргументов, но при этом указать количество разделений? В этом случае первым аргументом передаём None >>> "a\n b c".split(None, 1) ['a', 'b c'] Данный метод не учитывает строки с пробелами, взятые в кавычки 'a "b c" '.split() ['a', '"b', 'c"'] Но для таких случаев есть другие способы. #tricks#basic

Резултати

Пронајдени 33 слични објави

Пребарај: #groups

当前筛选 #groups清除筛选
The Telegram Times

@TheTGTimes · Post #272 · 14.02.2024 г., 14:06

📰Group Appearance Settings Upgrading your group will unlock new features for the group: - Color and Profile Logo - Group Status Emoji - Group Theme and Wallpaper - Group Emoji Pack #Boost | #Groups 👉The TG Times

The Telegram Times

@TheTGTimes · Post #264 · 13.02.2024 г., 10:22

📰Group Custom Emoji Pack Group Admins can set a Custom Emoji Pack for the group. All members can use emojis from this pack in the group, even without ⭐️ Premium subscription. #Boost | #Groups 👉The TG Times

The Telegram Times

@TheTGTimes · Post #262 · 13.02.2024 г., 10:14

📰Boost to send messages in the group Group admins can choose how many boosts a user must give to the group to bypass restrictions on sending messages. #Boost | #Groups 👉The TG Times

The Telegram Times

@TheTGTimes · Post #248 · 31.01.2024 г., 08:45

📰Boosting Groups Changes in the configuration of Telegram for macOS show that it will be possible to boost groups. After upgrading groups, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added. It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack. Thanks to @tgcrawl #Boost | #Groups 👉The TG Times

TGBlogLeaks

@TGBlogLeaks · Post #350 · 31.01.2024 г., 09:03

📰Boosting Groups Changes in the configuration of Telegram for macOS show that it will be possible to boost groups. After upgrading grouos, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added. It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack. Thanks to @tgcrawl #Boost | #Groups 👉The TG Times

iDubTG

@idubtg · Post #501 · 31.01.2024 г., 11:21

📰Boosting Groups Changes in the configuration of Telegram for macOS show that it will be possible to boost groups. After upgrading grouos, the ability to set the background for the group, choose the status emoji and choose the emoji pack for the group will be added. It seems that just as in groups, the special sticker pack for that group can be set, it will also be possible to choose the emoji pack. Thanks to @tgcrawl #Boost | #Groups 👉The TG Times

BotsGram®

@botsgram_cu · Post #3776 · 04.04.2021 г., 11:12

@TheNexasMusic_bot Qué puede hacer este bot? Con este bot puedes reproducir música nn grupos de telegram a través del chat de voz! Idioma: Inglés (visto en @BotsGram_cu) #groups, #music

BotsGram®

@botsgram_cu · Post #3774 · 04.04.2021 г., 01:31

@Gramaphone_voice_bot Qué puede hacer este bot? Con este bot puedes reproducir música nn grupos de telegram a través del chat de voz! Idioma: Inglés (visto en @BotsGram_cu) #groups, #music

BotsGram®

@botsgram_cu · Post #3712 · 24.03.2021 г., 11:04

@MultiForwardBot Qué puede hacer este bot? Este bot reenvía mensajes y medios de tu canal a grupos ilimitados de telegram! Idioma: Inglés, Italiano, Español (visto en @BotsGram_cu) #channel, #groups

ПретходнаСтраница 1 од 3Следна