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

Пребарај: #applynow

当前筛选 #applynow清除筛选
INHA University in Tashkent

@inha_uz · Post #7269 · 04.06.2024 г., 13:02

🔤🔤🔤🔤🔤🔤🔤🔤🔤🔤🔤 🔤🔤🔤🔤🔤🔤🔤🔤 Dear Prospective students, Only 10 days left to submit the applications for the second entrance exams! Hurry up to register and set yourself on the path to success with IUT⭐️ 📱Application platform: admissions.inha.uz Deadline: 1️⃣4️⃣ June 📹How to apply: https://www.youtube.com/watch?v=oobkqerc90I If you have any questions or need assistance, feel free to reach out to us by: 📞71 289 99 99 (0400) ⌨️@askinhabot We look forward to receiving your application and welcoming you to the IUT community ⭐️ Best regards, IUT Admissions Team #IUT#Admissions2024#ApplyNow

INHA University in Tashkent

@inha_uz · Post #7260 · 03.06.2024 г., 10:09

❤️‍🔥🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠2️⃣0️⃣2️⃣🔢❤️‍🔥 Dear Applicants, We are pleased to remind that the application period for the second admission is still open! If you have not applied yet, now is your chance to compete for the 9️⃣0️⃣ state scholarships, of which 6️⃣0️⃣ are for SOCIE and 3️⃣0️⃣ are for SBL. The 2nd entrance exam dates: SOCIE (scholarship) - June 21 SOCIE (contract) - June 22 SBL (scholarship and contract) - June 23 📱Application platform: admissions.inha.uz Apply now and seize the chance embark on a transformative academic journey with IUT! ⏱ Application deadline: June 14 📹 Video instruction: https://www.youtube.com/watch?v=oobkqerc90I For more information: 📞71 289 99 99 (0400) 😎@askinhabot Best regards, IUT Admissions Team #IUT#Admissions2024#ApplyNow

INHA University in Tashkent

@inha_uz · Post #7274 · 06.06.2024 г., 12:22

Do you want to study at the university of your dreams? We are waiting for you⚡️ Admission is open! Watch a video report from students life at Inha university in Tashkent 🤩 Apply now⭐️ Registration: admissions.inha.uz How to apply: https://www.youtube.com/watch?v=oobkqerc90I #applynow#inhauniversity ➖➖➖ O'zingiz orzu qilgan universitetda o'qishni xohlaysizmi? Hoziroq murojaat qiling⭐️ Toshkent shahridagi Inha universiteti talabalari hayotidan videoreportajni tomosha qiling 🤩 Roʻyxatdan oʻtish uchun havola: admissions.inha.uz Hujjat topshirish bo'yicha video qo'llanma:https://www.youtube.com/watch?v=oobkqerc90I #hozirgi#inhauniversity ➖➖➖ Хотите учиться в Университете своей мечты? Мы ждём вас⚡️ Посмотрите видеоотчет из студенческой жизни Университета Инха в Ташкенте 🤩 Подайте заявку сейчас⭐️ Регистрация: https://admissions.inha.uz Как подать заявку: https://www.youtube.com/watch?v=oobkqerc90I #applynow#inhauniversity

Opportunities with Zula

@opportunities_zula · Post #1857 · 16.04.2026 г., 15:42

Bangkok is Calling Future Leaders! Visit: https://tinyurl.com/fms-thailand2026 Applications are now open for the GYN FutureMinds Summit 2026 in vibrant Bangkok, Thailand Whether you're a student, graduate, or professional (ages 16–45), this is your chance to connect, learn, and lead on a global stage. No specific background required — just passion and vision! What’s Covered? Airfare Accommodation Meals & Tea Breaks Visa Support & Fees (if applicable) Speaking Opportunity Cultural Fest & Social Activities Certification Join a diverse network of changemakers, gain international exposure, and make your voice heard where it matters. Tag someone who shouldn’t miss this opportunity! #FutureMindsSummit#FullyFunded#YouthLeaders#GlobalOpportunities#Bangkok2026#Changemakers#ApplyNow