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

Пребарај: #builders

当前筛选 #builders清除筛选
DWF Labs Broadcast

@DWFLabs · Post #244 · 09.03.2023 г., 00:00

We're excited to be able to support the mission of Tonstarter in bringing #builders, #community and #capital together to accelerate the growth of #TON ecosystem. Let's keep working towards building a future for TON together! ✨ Full announcement here. // About Tonstarter: ▫️Tonstarter is the first TON-native launchpad, enabling crypto projects to raise capital in a decentralized, safe, and user-friendly environment. Find out more here.

DWF Labs Broadcast

@DWFLabs · Post #251 · 15.03.2023 г., 00:00

Congratulations Tonstarter on closing a $1.5 million investment seed round! 🎉 We're proud to support your mission to unite #builders, #community, and #capital to accelerate the #growth of TON ecosystem ⚡ It's exciting to be building a bright future together 🫡 Full announcement here.

Crypto M - Crypto News

@CryptoM · Post #65181 · 11.04.2026 г., 16:54

🚀 Market Conditions Present Opportunities for Strategic Investments, Says DWF Labs Co-Founder The cryptocurrency market is currently experiencing a "very boring" phase, according to ChainCatcher. DWF Labs Co-Founder Andrei Grachev expressed on social media that while participants may engage in discussions or humor, significant activities such as financing, trading, investing, and business expansion are quietly underway. Grachev noted that the current market environment poses challenges for major projects, exchanges, and companies to make new listings or significant announcements, as high-profile actions may not be effective at this time. He advised maintaining patience in investment portfolios and waiting for more opportune moments. He emphasized that the market is not in decline but rather offers opportunities for seemingly mundane activities, such as buying and holding Bitcoin long-term or engaging in altcoin speculation. Grachev concluded that there is still much to do for builders and investors, while smaller investors should focus on learning, avoid lamenting losses, and enjoy the market they have chosen to enter. #cryptocurrency#marketconditions#investmentopportunities#DWF Labs #AndreiGrachev#bitcoin#altcoin#longtermholding#speculation#investors#builders#patience#learning#BTC