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

Резултати

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

Пребарај: #pollution

当前筛选 #pollution清除筛选
Amazing Geography 🌍

@amazingeo · Post #308 · 28.09.2025 г., 18:31

🌍 Over 90% of the world’s plastic is not recycled, and much ends up in the oceans. Ocean plastic has been found in Arctic ice and inside some of the deepest-living sea creatures. ✨ #pollution⚡#environment⚡#oceans⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

世界观察日志

@WorldObservationLog · Post #1334 · 02.09.2022 г., 08:26

近期,台湾有用户称在访问 Google 时被网页提示涉及诈骗。受影响的网站还包括 Google 地图及部分新闻网站。ISP 台湾大哥大解释称,问题原因是当日执行防诈骗相关测试。部分网友由此联想到近期通过的《中介法》,认为这可能是台湾 ISP 大规模屏蔽内容的开始。 台湾 NCC 近期通过《數位中介服務法》(简称中介法)草案,称仿效欧盟 Digital Services Act,要求平台对内容进行监管,产生一些争议。有观点认为法律规范不明确,且平台实际管理困难,恐损害言论自由。 https://tw.news.yahoo.com/google首頁被警告是詐騙-044720539.html 1. https://tw.news.yahoo.com/數位中介服務法-數位中介法-中介法-言論自由-正反意見-110307205.html #Taiwan#DNS#Pollution

Amazing Geography 🌍

@amazingeo · Post #573 · 13.01.2026 г., 12:31

🌍 Russia’s Lake Karachay is so contaminated from past nuclear waste that standing on its shore for just an hour could be fatal—one of the most polluted lakes on the planet. ✨ #rivers⚡#lakes⚡#pollution⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #347 · 08.10.2025 г., 15:31

🌍 Air pollution now causes more deaths worldwide than unsafe water or malaria, with tiny particles harming lungs and hearts. Even remote regions like the Himalayas register rising airborne pollutants. ✨ #pollution⚡#health⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #30 · 10.08.2025 г., 14:31

🌍 The Great Pacific Garbage Patch is a floating area of plastic and debris in the Pacific Ocean, now estimated to be more than twice the size of Texas. It affects sea life far beyond its borders. ✨ #pollution⚡#ocean⚡#plastics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #570 · 11.01.2026 г., 20:31

🌍 The Great Pacific Garbage Patch, a swirling mass of plastic debris, now covers an area larger than Germany. Ocean currents trap millions of tons of waste here, creating a persistent global pollution hotspot. ✨ #pollution⚡#oceans⚡#plastics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #77 · 19.08.2025 г., 13:12

🌍 Light pollution from cities is so widespread that more than 80% of the world's population can no longer see the Milky Way at night, affecting wildlife and our connection to the night sky. ✨ #environment⚡#pollution⚡#light⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #27 · 10.08.2025 г., 14:03

🌍 Tiny plastic particles, called microplastics, have been found in remote places like Arctic snow and deep-sea trenches, showing how far pollution can travel across the planet. ✨ #environment⚡#pollution⚡#microplastics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #691 · 15.04.2026 г., 20:31

🌍 Air pollution is now the world’s leading environmental health risk, causing more than 6 million early deaths yearly—fine particles from burning fuel can travel and harm people far from their source. ✨ #pollution⚡#health⚡#global⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

MALI 24

@kamissokosekou3 · Post #36533 · 27.04.2026 г., 09:39

https://t.me/kamissokosekou3 ⚠️ Falémé : pollution alarmante, un fleuve vital en danger Le fleuve Falémé, essentiel entre Mali, Sénégal et Guinée, est fortement menacé par la pollution liée à l’activité minière. Présence de cyanure, raréfaction des poissons, risques sanitaires : la situation inquiète particulièrement dans la région de Kéniéba. 👉 Faut-il renforcer les contrôles miniers pour sauver la Falémé ? Réagissez et partagez. NB: image d'illustration générée par IA. #Mali#Environnement#Faleme#Pollution#Afrique#ecologie La rédaction

籽煤 yseedsmedia

@yseedsmedia · Post #432 · 20.12.2021 г., 04:58

全球關注環境污染問題,印度是全球排行第三的碳排放國家,僅次美國及中國。為了可以大幅提升可再生能源的使用率及在2070年實現零碳排,同時為降低對中國太陽能材料的依賴,印度宣布將「打造本土太陽能供應鏈」。 外媒分析,中國在太陽能供應鏈市場一直有領導地位,全球達四分之三的太陽能板材料由中國生產出及供應。如果印度未能完善執行計畫,恐造成國內太陽能電池板成本飆升,當地工廠恐怕要蒙受巨大損失。 #印度#環境污染#碳排放#美國#中國#可再生能源#零碳#太陽能#供應鏈#中共#印度加油#india#pollution#carbondioxide#china#USA#supplychain#sunlight #yseedsmedia#籽煤#新聞#熱門新聞#香港人的新聞#香港人#hongkonger#香港加油 Follow and share us: IG: instagram.com/yseedsmedia/ Fb: fb.com/yseedsmedia Tg: t.me/yseedsmedia