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

Резултати

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

Пребарај: #stepmania

当前筛选 #stepmania清除筛选

🚶‍♂️Step Up and Win – StepMania’s Giveaways Continue! The first giveaway has taken place, and the winners are already receiving their prizes!🎁3 iPhone 16 Pro devices, fitness bracelets, Telegram Premium subscriptions, and game coins – distributed fairly, won deservedly! Congratulations to the winners! 🏆 But this is just the beginning! 🚀More giveaways are coming, which means you still have a chance to claim your prize from #StepMania! How to Participate? ✅ Walk and earn tickets 🎁 ✅ Spend them to join the giveaway! 🎲 ✅ Bring your friends along – walking together is more fun, and winning is easier! Get +1 ticket for every friend you bring! 📞Great news for Android users! 👌Logging in is now much easier – no need to install multiple apps to sync your steps. Just open StepMania and start walking towards your prizes! 📍 Excited for the next giveaway? Don’t miss out – start moving towards victory now!

Hashtags

TONlines – News

@tonlines · Post #7205 · 13.05.2025 г., 16:58

Tonstakers Teams Up with StepMania for Giveaway #StepMania#TON Tonstakers and StepMania have launched a new campaign offering prizes for active stakers, including a PlayStation 5 for one lucky winner. Participants must stake at least 3 TON and follow specified steps by May 23 to enter the raffle. Source: link @tonlines

🏃‍♂️StepMania: Earn by Simply Walking!New Project on Telegram 👍 Many projects promise profits but often lead to disappointment. People invest their time, energy, and health, only to receive neither real benefits nor enjoyment. But what if the process itself is useful and enjoyable? In that case, you always win. 🔠The mission of the project is build a long-term initiative that motivates people to move more and make an active lifestyle a daily habit. ✅Listing and cryptocurrency conversion are exciting, but the real reward is in movement! Every step not only brings potential earnings but also boosts your energy, improves well-being, and gives you a sense of accomplishment. As a bonus — regular prize draws and the chance to win gadgets, subscriptions, stars, and other rewards! 🎁 👍The project is launching with the support of 🙏TOP(The Open Platform) — a key player in the #TON ecosystem, with major projects in its portfolio such as Tonkeeper, Getgems, and STONfi.#StepMania project has been spotlighted on top-tier news platforms: 🤑Binance Square and 🪙CoinMarketCap 👟Let’s move the planet together! Want to partner? Contact for partnerhip🤝 Website | Community | Mini-app | X

Crypto currents | Money, Games, News.

@cryptocurrentsglobal · Post #3030 · 07.02.2025 г., 11:16

🔤🔤🔤🔤🔤 StepMania is officially live! 🥂 More steps – more coins, guys! StepMania is not just a pedometer but a move-to-earn app where every step is rewarded, new records keep you motivated, and the community fuels the excitement. How does StepMania work? 🌎Pedometer – track your activity and set personal records! 🥇Leaderboards – compete with friends and other users to reach the top! 💬Community – share your achievements, exchange tips, and stay motivated! 🏳️Plus, awesome giveaways! Gadgets, subscriptions, and other bonuses for active users right from the start! Stop tapping! With StepMania, walking is not just healthy but also rewarding. Step up and earn. Walk to Earn Join the game👉link #Stepn#Stepmania#Earn Crypto Currents | Get referrals | Buy Telegram Stars