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

Резултати

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

Пребарај: #mikeymusumeci

当前筛选 #mikeymusumeci清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1808 · 24.04.2025 г., 17:30

🔥NEW RELEASE🔥 😁Slicin' Calves By Mikey Musumeci😁 ➡️Mikey Musumeci, one of the most accomplished and detail-oriented American grapplers of all time, brings you a game-changing BJJ instructional that dives deep into one of the most lethal and versatile submissions in no-gi grappling: the Calf Slicer ➡️Whether you’re attacking the legs with a heel hook, straight footlock, or kneebar, Mikey shows you how to use the inevitable escape of your opponent to effortlessly transition into the calf slicer. ➡️With Mikey’s methodical approach and world-class attention to detail, you’ll gain the tools to dominate from bottom to top, turning every leg attack into a calf slicer opportunity. $197😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #MikeyMusumeci#Leglocks#NoGi#IBJJF 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1775 · 02.03.2025 г., 00:17

🔥NEW RELEASE🔥 😁Fundamentals Of Guard Passing: Breaking Their Guard - Wall By Wall By Mikey Musumeci😁 ➡️Discover the Fundamentals of Guard Passing: Breaking Their Guard - Wall by Wall with BJJ legend Mikey Musumeci. As a multiple-time World Champion, ONE Championship star, and now UFC Fight Pass sensation ➡️Mikey brings his unmatched expertise to the world of guard passing, breaking down the essential foundations you need to elevate your no-gi game. ➡️In this groundbreaking first-ever instructional, Mikey Musumeci reveals the strategies and techniques that have made him one of the most dominant forces in the world of Brazilian Jiu-Jitsu $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #MikeyMusumeci#OneFC#UFC#UFCFightPass 💁‍♀️Buy 💁‍♀️