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

Резултати

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

Пребарај: #drought

当前筛选 #drought清除筛选
Red Nile

@rednile12 · Post #10814 · 20.01.2026 г., 13:25

በ2020ው የዋሽንግተን ረቂቅ የስምምነት ሰነድ አሜሪካ እና ግብፅ እንደ ወጥመድ የተጠቀሙት "DROUGHT" እና "WATER FLOW" ዋሽንግተን ላይ ተደርጎ በነበረው ድርድር የአየር ሁኔታን ተገን አድርገው ግብፅ እና አሜሪካ "Historic Right" የሚለውን የግብፅን የቅኝ ግዛት ትሪክት " #DROUGHT" የሚል ካባ አልብሰው በ2020ው የዋሽንግተን ረቂቅ የስምምነት ሰነድ ውስጥ እንደት እንዳስገቡ እንመልከት ወደ ዋሽግተኑ ረቂቅ የስምምነት ሰነድ ከመሄዳችን በፊት ትራምፕ ጃንዋሪ 16፣ 2026 ላይ “በድርቅ እና ለረጅም ጊዜ ደረቅ ዓመታት ለግብፅ እና ለሱዳን የሚለቀቁ የውሃ ልቀት ሊተነብይ የሚችል ይሆናል” ብሎ ለፍሬንዱ አል ሲሲ የላከውን መልዕክት ስንመረምር መልዕክቱ የተቀዳችው ከረቂቅ ሰነዱ ይሆን🤔? የሚል ጥርጣሬም ያጭራል:: ጥርጣሬውን እንደጥርጣሬ ይዘን👇 በ2020 የዋሽንግተን ረቂቅ ሰነድ ውስጥ የሰፈሩት “ድርቅ” እና “ረዥም ጊዜ ደረቅ ዓመታት” ለሚሉ አባባሎች፤ ኢትዮጵያ አባባሎቹ አደገኛ ወጥመድ ናቸውና ከትርጓሜያቸው ጀምሮ መስተካከል አለባቸው ስትል ተከራክራለች:: 🔻Continued Below @rednile12

Hashtags

Addis Standard

@addisstandardeng · Post #21904 · 01.04.2026 г., 13:07

‘Sharing is off the table’ as #drought reshapes the lives of #Ethiopia’s pastoralists Pastoralists in Ethiopia’s #Somali region say that worsening drought is eroding traditional systems of sharing that once helped communities survive. Historically, Somali pastoralists survived drought through strong social networks. These Indigenous climate adaptations were built on an intricate system of mutual aid. One of the most important systems is known as Gergar, a form of social insurance in which families who lose livestock receive animals from relatives and neighbors to help rebuild their herds. “When people used to lose livestock, others would help them,” says Mohamed Abdi, a lifelong pastoralism advocate and director at Jijiga University’s Institute of Pastoral and Agro-Pastoral Development Studies. “We would move to relatives or sub clan areas, and they shared water and pasture with us.” https://news.mongabay.com/2026/04/sharing-is-off-the-table-as-drought-reshapes-the-lives-of-ethiopias-pastoralists/

Addis Standard

@addisstandardeng · Post #21345 · 09.02.2026 г., 06:51

'Our children are next' fear #Kenyans as #drought wipes out livestock In drought-hit northeastern Kenya, villagers have been forced to drag their dead livestock to distant fields for burning to keep the stench of death and scavenging hyenas away from their homes. Mandera county along Kenya's borders with Ethiopia and Somalia has seen no rain since May and is now on the point of a full-blown water emergency. "I have lost all my cows and goats, and burned them here," Bishar Maalim Mohammed, 60, a resident of Tawakal village, told AFP. In his village, where most are pastoralists relying heavily on their animals, the only remaining bull can no longer stand. He has lain in the same spot for nearly a week, severely dehydrated with bones protruding through his skin, as his owner watches helplessly. https://addisstandard.com/?p=55089

Interesting Planet 🌍

@interesting_planet_facts · Post #492 · 03.08.2025 г., 16:22

🌎 The Madagascan baobab, sometimes called the “upside-down tree,” stores thousands of liters of water in its massive trunk, allowing survival through severe drought. This clever reservoir keeps it lush while nearby plants wilt. ✨ #Madagascar⚡#baobab⚡#drought 👉subscribe Interesting Planet

Reuters: World

@reutersworldchannel · Post #149409 · 15.10.2021 г., 14:23

Northern Kenya drought pushes millions to hunger The lack of rain in northern Kenya means 2.4 million people in the region will struggle to find enough to eat by November, the United Nations World Food Programme says. #News#Reuters#Kenya#drought#food#environment Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Reuters: World

@reutersworldchannel · Post #149225 · 11.10.2021 г., 17:07

U.N. warns of Madagascar 'climate change famine' Madagascar produces less than 0.01% of global carbon dioxide emissions, but amid a fourth year of drought in the Grand Sud region, the U.N. is warning of a 'climate change famine'. #Madagascar#UN#UnitedNations#ClimateChange#ClimateChangeFamine#GrandSudRegion#Drought#News#Reuters Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖