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

Резултати

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

Пребарај: #permafrost

当前筛选 #permafrost清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #825 · 27.09.2025 г., 22:11

🌎 In the Norwegian Arctic, the town of Longyearbyen bans dying at home, as bodies can't decompose in permafrost. Residents who are terminally ill must travel to the mainland. This small settlement is also the northernmost town with over 1,000 people. ✨ #arctic⚡#settlements⚡#permafrost 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #580 · 18.08.2025 г., 00:22

🌎 The Siberian permafrost preserves ice age seeds for tens of thousands of years. Scientists have revived ancient plants, like Silene stenophylla, from seeds frozen over 30,000 years ago—proving some life can return after millennia in the deep freeze. ✨ #permafrost⚡#botany⚡#revival 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #729 · 11.09.2025 г., 16:22

🌎 Norilsk, Russia, is a city built above the Arctic Circle and is so remote that it’s closed to most foreigners. Founded in 1935 for nickel mining, it endures harsh winters with temperatures as low as −55°C. Norilsk is one of the largest cities in continuous permafrost and has no rail or road connection to the rest of Russia. ✨ #Norilsk⚡#Arctic⚡#permafrost 👉subscribe Interesting Planet ​

Amazing Geography 🌍

@amazingeo · Post #206 · 09.09.2025 г., 16:12

🌍 Some tundra soils contain buried ice wedges that can be thousands of years old. When permafrost thaws, these ancient ice wedges melt, creating strange sinkholes called "thermokarst." ✨ #permafrost⚡#tundra⚡#landscape⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #547 · 31.12.2025 г., 12:31

🌍 In tundra landscapes, some mosses and lichens can survive temperatures below –50°C and continue to photosynthesize under snow, making them some of the Earth’s hardiest plants. ✨ #tundra⚡#permafrost⚡#adaptation⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #668 · 21.03.2026 г., 20:31

🌍 In the far north, frozen permafrost soils hide ancient bacteria and seeds that can survive for thousands of years—emerging only when the tundra thaws after centuries of deep freeze. ✨ #permafrost⚡#tundra⚡#arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #626 · 11.02.2026 г., 20:31

🌍 In the Siberian tundra, permafrost preserves massive underground "ice wedges" that crack open each winter and refill with meltwater every spring, leaving polygon patterns visible from above. ✨ #permafrost⚡#tundra⚡#arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #439 · 07.11.2025 г., 12:31

🌍 Some tundra ponds form when summer sun thaws just the surface of permafrost, creating seasonal lakes that vanish each year. These ponds support bursts of life in otherwise frozen landscapes. ✨ #tundra⚡#permafrost⚡#arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #326 · 03.10.2025 г., 12:31

🌍 In the Arctic tundra, some permafrost layers are over 1,500 meters thick—deeper than most skyscrapers are tall. This frozen ground stores ancient DNA from plants and animals tens of thousands of years old. ✨ #permafrost⚡#tundra⚡#arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #245 · 16.09.2025 г., 03:12

🌍 In some Arctic tundra areas, ancient animal tracks remain frozen in permafrost for thousands of years. When the ground thaws, these footprints reappear, revealing hidden stories of past wildlife. ✨ #permafrost⚡#tundra⚡#Arctic⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1120 · 11.12.2025 г., 18:11

🌎 Every summer in Siberia, mysterious craters known as "Yamal holes" appear in the Arctic tundra. These giant pits, sometimes 20 meters wide, form when underground methane gas builds pressure and violently explodes through permafrost. Scientists have identified at least 17 such craters since 2014, linking them to warming temperatures and melting ice. ✨ #permafrost⚡#methane⚡#explosions 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #708 · 06.05.2026 г., 20:31

🌍 In parts of Siberia, thawing permafrost can trigger sudden ground collapses called “thermokarst.” These sinks reshape the tundra and can swallow trees or create lakes almost overnight. ✨ #permafrost⚡#tundra⚡#landforms⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

12
ПретходнаСтраница 1 од 2Следна