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

Резултати

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

Пребарај: #methane

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

@interesting_planet_facts · Post #1001 · 03.11.2025 г., 18:11

🌎 In the deep ocean, methane hydrate deposits form icy, flammable crystals that trap methane gas in water molecules. These deposits occur at high pressure and low temperature, mainly along continental margins, and may hold more carbon than all other fossil fuels combined. ✨ #ocean⚡#geology⚡#methane 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #422 · 29.10.2025 г., 20:31

🌍 Global methane emissions from wetlands are rising due to warmer temperatures and increased rainfall. This powerful greenhouse gas traps far more heat than carbon dioxide in the atmosphere. ✨ #climate⚡#wetlands⚡#methane⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #366 · 13.10.2025 г., 12:31

🌍 In tundra regions, permafrost can sometimes trap ancient methane gas. When the ground thaws, bubbles of this gas may rise and burst at the surface, creating sudden pops in the landscape. ✨ #permafrost⚡#tundra⚡#methane⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #522 · 08.08.2025 г., 16:22

🌎 A layer of diamond rain may fall deep within Neptune and Uranus! Under immense pressure, methane breaks apart, causing carbon atoms to form glittering diamond crystals that drift towards the core. ✨ #planets⚡#diamonds⚡#methane 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #496 · 05.12.2025 г., 20:31

🌍 Melting permafrost in Arctic regions is releasing ancient greenhouse gases like methane, accelerating climate change and threatening traditional ways of life for local communities. ✨ #permafrost⚡#climate⚡#change⚡#methane⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

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 ​

Universe Mysteries 🪐

@cosmomyst · Post #83 · 05.08.2025 г., 03:11

🪐 Saturn’s moon Titan is one of the most intriguing places in the solar system where life could exist because it has lakes and rivers of liquid methane and ethane—chemicals similar to gasoline on Earth. While it’s far too cold for liquid water, scientists are captivated by the idea that life, if it ever formed there, would be fundamentally different from anything on our planet. ✨ #Titan⚡#methane⚡#habitability⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #132 · 14.08.2025 г., 16:11

🪐 Scientists have detected unusual patterns of methane gas in the atmosphere of Mars, with the Curiosity rover finding short-lived spikes near the Gale Crater. Since methane can be produced by both geological processes and living microbes, its mysterious appearance and disappearance on Mars keeps the search for alien life in our own solar system wide open. ✨ #Mars⚡#Curiosity⚡#methane⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

В журнале Electrochemical Materials and Technologies вышла обзорная работа "H/D exchange studies of methane activation mechanisms in heterogeneous catalysis" 🔗https://doi.org/10.15826/elmattech.2023.2.014 🔗https://journals.urfu.ru/index.php/elmattech/article/view/6883 В данном обзоре подробно рассматривается механизм конверсии метана и анализируются существующие теоретические и экспериментальные подходы к изотопному обмену H/D между метаном и каталитическими системами: #CH4#methane#conversion#isotope#catalyst#bonds#homogeneous#exchange #