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

Резултати

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

Пребарај: #congratulations

当前筛选 #congratulations清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #11802 · 05.03.2026 г., 15:04

#Congratulations 🧡 Nargis Kosimova, Director of the “Ekolog” Public Association, has been awarded the “Mo‘tabar Ayol” badge In accordance with the Decree of the President of the Republic of Uzbekistan dated February 2, 2018, No. PF-5325, “On measures to fundamentally improve activities in the field of supporting women and strengthening the family institution,” the “Mo‘tabar Ayol” badge was established. This award is given to women who have shown activity and initiative in public and state life, contributed through their effective work to the stability and prosperity of families, the protection of motherhood and childhood, and have set an exemplary example in raising healthy and well-rounded generations in the spirit of patriotism and loyalty to the ideals of independence, promoting moral and ethical values locally, and broadly spreading national values. The “Mo‘tabar Ayol” badge is presented by the Women’s Committee of Uzbekistan on the eve of International Women’s Day, March 8. 🌿 The team of the “Ekolog” Public Association sincerely congratulates Nargis Kosimova on receiving this prestigious award! ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

VISION11

@vision11official · Post #903 · 08.10.2022 г., 09:44

#Congratulations🥳 "Nikhil" for your amazing kabaddi skills and to be the luckiest winner of our coin-toss representative.🥳 Keep going, abhi to leaderboard baki hai😜 . . . Download App👇 https://vision11.in/APK/vision11.apk

Ethio-Djibouti Railway S.C.

@ethiodjiboutirailway · Post #1360 · 25.01.2024 г., 05:06

Congratulations to the fourteen train driver trainees who have successfully completed their training! January 24, 2024(EDR); During their one year training period, the trainees have successfully finished their theoretical and practical training. That provided by the Ethiopian-Djibouti Railway Capacity Building program’s fourth round. Today, they took their Ministry of Transport and Logistics qualification exam, and now one step closer to obtaining their licenses and starting their careers as train drivers. We are incredibly proud of their hard work and commitment, and we wish them all the best in their future endeavors! #EthiopiaDjiboutiRailway#EthiopiajiboutiRailwayfamily#CapacityBuilding #TrainDriverTraining#Congratulations

VISION11

@vision11official · Post #1008 · 19.12.2022 г., 09:48

The D-Day on #vision11 is here! 🏆 Here are our top 3 winners for #PKL2022 Leaderboard contest!🎖 #Congratulations to all of you!🎉 Aap bhi ho sakte ho agle winner, abhi #vision11 download karo aur khelo 100+ contests to win big!💯 . . . Download App👇 https://vision11.in/APK/vision11.apk

Matbuot va ommaviy axborot vositalari xodimlari kuni muborak boʻlsin! Hurmatli ommaviy axborot vositalari xodimlari, sizlarni "27-iyun – Matbuot va ommaviy axborot vositalari xodimlari kuni” munosabati bilan tabriklaymiz. Ushbu quvonchli ayyomda barchangizga sihat-salomatlik, sharafli faoliyatingizda yangi yutuq va omadlar, xonadoningizga tinchlik va fayzu baraka tilaymiz. Kasb bayramingiz muborak boʻlsin! Hurmat bilan, “Yangi Oʻzbekiston” universiteti jamoasi 🔁English ➖➖➖➖➖➖➖➖➖➖➖➖➖➖ #Press#congratulations#Tabrik ⬇️Biz ijtimoiy tarmoqlarda: Veb-sayt | Telegram | Instagram | Facebook

123•••67
ПретходнаСтраница 1 од 7Следна