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

Пребарај: #microsoftuzbekistan

当前筛选 #microsoftuzbekistan清除筛选
MDC Uzbekistan

@mdcuzbekistan · Post #1006 · 12.11.2025 г., 09:13

🎉 Microsoft Community Conf 2025 is here! Microsoft Developers Community in Uzbekistan (MDC Uzbekistan) is a vibrant network of developers, engineers, and tech enthusiasts passionate about Microsoft technologies. We organize meetups, workshops, and large-scale events to empower the local tech ecosystem and connect innovators across Uzbekistan. 📢 About the conference: Our flagship event, Microsoft Community Conf 2025, brings together tech enthusiasts from all over Central Asia! Explore the latest in AI, .NET, Cloud, DevOps, Data, and more through inspiring keynotes and hands-on sessions with industry experts. 📅 Date: November 22, 2025 📍 Location: Palace of Youth Creativity, Tashkent 🏢 Company Corners: Meet representatives from EPAM, BRB-TECH, IMAN, and other leading companies. Network, showcase your skills, and discover new opportunities. 💼 Bring your CV – your next big opportunity could be waiting for you! ✅ Secure your spot: Register Now #MDCUConf2025#MicrosoftUzbekistan Telegram | Instagram | Website

MDC Uzbekistan

@mdcuzbekistan · Post #910 · 20.11.2024 г., 06:01

Exciting Announcement: The Tech Joined Us as a Media Partner! We are proud to welcome The Tech as an official media partner of the MDC Uzbekistan. This partnership marks the beginning of an exciting collaboration to support all our initiatives, including hackathons, conferences, and other key events. With The Tech’s support, we’re set to expand our reach and inspire even more developers across Central Asia. Together, we’ll continue building a stronger tech community! #MicrosoftDevelopersCommunity#TheTech#MediaPartner#TechEvents#MicrosoftUzbekistan @mdcuzbekistan

MDC Uzbekistan

@mdcuzbekistan · Post #975 · 03.11.2025 г., 12:30

🌟 Call for Sponsors — MDCU Conf 2025 We’re thrilled to announce that MDCU Conf 2025 is almost here! 🎉 As we bring together developers, IT professionals, and tech leaders from across the region, we’re inviting organizations and brands to join us as official sponsors of this exciting event. 🚀 💡 Why sponsor? - Connect with hundreds of developers and decision-makers - Increase brand visibility within the Microsoft ecosystem - Build lasting relationships with the local and regional tech community - Showcase your innovations through booths, talks, and demos 📅 Event Date: November 22, 2025 📍 Location: Palace of Youth Creativity, Tashkent ✨ Let’s collaborate to empower innovation and grow the tech community in Uzbekistan! 👉 Interested in sponsoring? Reach out to @dotnetgo or @g_voriskhon #MDCUConf2025#MicrosoftUzbekistan#TechConference#Sponsorship#DeveloperCommunity#Innovation Telegram | Instagram | Website