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

Резултати

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

Пребарај: #bernardofaria

当前筛选 #bernardofaria清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1776 · 02.03.2025 г., 19:08

😁Foundations Of Brazilian Jiu Jitsu No-Gi By Bernardo Faria😁 ➡️With this easy-to-learn system, you will build a strong foundation tailored for No-Gi ➡️The fundamentals are the cornerstone of Jiu Jitsu, and in No-Gi, mastering the basics is what leads to victory ➡️Bernardo's game is renowned as the best for older grapplers because it is simple, easy to understand, and doesn't rely on athleticism $99😍$9.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BernardoFaria#BJJFanatics#NoGi#BJJ 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1800 · 10.04.2025 г., 19:24

🔥NEW RELEASE🔥 😁Jiu-Jitsu For Old Guys: Guard Retention By Bernardo Faria😁 ➡️Unlock the secrets to maintaining a strong guard and thriving on the mats with Bernardo Faria’s proven methods. As a 5x Black Belt World Champion, Faria has crafted this instructional specifically for older grapplers looking to retain guard with minimal energy expenditure while focusing on the fundamentals. ➡️With his in-depth understanding of leverage, timing, and the small details that make a big difference, Faria's Guard Retention series is a game-changer for older practitioners looking to elevate their Jiu-Jitsu without burning out. ➡️Whether you're a seasoned practitioner or just getting started, you'll learn how to guard with confidence and mastery, adapting the principles of BJJ to your unique body and experience level. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BernardoFaria#BJJFanatics#Guard#Gi 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1925 · 25.03.2026 г., 22:06

😁Jiu Jitsu For Old Guys: Entries For Over Under by Bernardo Faria😁 ➡️Unlock the secrets to one of the most effective and accessible passing techniques in Brazilian Jiu-Jitsu with Jiu-Jitsu for Old Guys: Entries For Over Under by Bernardo Faria — 5x Black Belt World Champion, BJJ Fanatics Co-founder, and best-selling instructor. ➡️Designed specifically for older practitioners, this series emphasizes technique over athleticism, helping you maintain a competitive edge without relying on explosive power or speed $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #BernardoFaria#Transitions#Gi#BjjFanatics 💁‍♀️Buy 💁‍♀️