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 слични објави

Пребарај: #gemifaucet

当前筛选 #gemifaucet清除筛选
Gemi Faucet News

@gemifaucet · Post #1577 · 05.05.2026 г., 06:06

🎯Big Opportunity: Turn 2 TON into 100 TON!💰 Get ready to test your luck with our latest Lottery Draw on Gemifaucet! 🎟Ticket Price: Only 2 TON 🏆Winning Prize: Up to 100 TON ⏳Draw Time: Every 3 Days Here’s your chance to multiply your TON in a simple and exciting way. Just grab your ticket, sit back, and wait for the draw — one lucky winner will walk away with a massive reward! 🔥 Don’t miss out — the sooner you enter, the bigger the prize pool grows. 🚀Buy your ticket now and secure your chance to win big! #Gemifaucet#Lottery#WinTON#CryptoOpportunity Buy Now

Gemi Faucet News

@gemifaucet · Post #1573 · 04.05.2026 г., 18:47

🎉Exciting Update: Lottery Feature is Now Live on Gemifaucet!🎉 We’re thrilled to introduce a brand-new way to win big on Gemifaucet — our Lottery System is officially launched! 🎟How it works: * Purchase your lottery tickets directly داخل the app * Each ticket gives you a chance to win * One lucky winner takes home the entire prize pool💰 🔥 The more participants, the bigger the rewards — so don’t miss your chance to be part of it! This feature is designed to make your experience more engaging, rewarding, and fun. Whether you're a regular user or just getting started, now is the perfect time to try your luck. 🚀Start buying your tickets today and aim for the jackpot! Stay tuned for more updates and features coming soon. #Gemifaucet#LotteryLaunch#WinBig#CryptoRewards

Gemi Faucet News

@gemifaucet · Post #771 · 10.02.2026 г., 07:09

💥 OFFICIAL PARTNERSHIP ANNOUNCEMENT 💥 We’re pleased to announce an official partnership between Gemifaucet and AdsGram, focused on improving monetization quality and user experience across our platform. 🚀 About Gemifaucet Gemifaucet is a Telegram mini app where users receive rewards by interacting with tasks and ads in a simple, transparent, and user-friendly environment. 📊 About AdsGram AdsGram is a leading Telegram Native Ads platform trusted by top Telegram apps and communities. It provides seamless, non-intrusive ad solutions with strong performance, advanced analytics, and a proven monetization ecosystem. 🤝 Why this partnership matters By this official partnership formalizes our collaboration and strengthens our monetization infrastructure. 👉 Gemifaucet: @gemifaucet_bot 👉 AdsGram: @adsgram_ai Thank you for your continued support — more updates coming soon! 🚀 #OfficialPartnership#Gemifaucet#AdsGram#TelegramMiniApp#Announcement