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

Резултати

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

Пребарај: #nwo

当前筛选 #nwo清除筛选
Indian Development News 🇮🇳

@developmentnewsindia · Post #44329 · 02.05.2026 г., 10:27

Breaking: At the Peace Dialogues held between Pakistan and Afghanistan in Turkey, IHH, the org hosting the dialogue in Turkey, removed PoK, Balochistan and parts of Khyber Pantukhwa from Pakistan's map. #NWO#Geopolitics

Indian Development News 🇮🇳

@developmentnewsindia · Post #43826 · 20.04.2026 г., 04:43

BREAKING 🇦🇪⚡🇺🇸 A post on X by Abdulkhaleq Abdullah, adviser to the UAE president: “The UAE no longer needs the United States to defend it, as it has proven during Iranian aggression that it is fully capable of defending itself with competence.” “It is time to consider closing U.S. bases in the Arabian Gulf, as they are a burden on the UAE.” #Geopolitics#NWO

Indian Development News 🇮🇳

@developmentnewsindia · Post #43821 · 20.04.2026 г., 02:36

UAE to Trump Administration: "You started this war; if we run short of USDs as a result of it, either you will give us USD swap lines, or we will be forced to start transacting oil and gas in CNY and other currencies." -Via Wall Street Journal #NWO#geopolitics

Indian Development News 🇮🇳

@developmentnewsindia · Post #43877 · 21.04.2026 г., 07:14

🇯🇵 Prime Minister of Japan Sanae Takaichi "Today, we amended the 'Three Principles on Transfer of Defense Equipment and Technology' and their 'Guidelines for Implementation.' Until now, the overseas transfer of domestically produced finished products had been limited to search and rescue, transportation, surveillance, mine countermeasures (so-called 'five categories'), but with this amendment, transfers of all defense equipment will in principle become possible. In an increasingly severe security environment, no single country can now protect its own peace and security alone, and partner countries that support each other in terms of defense equipment are necessary." #InternationalNews#NWO

Indian Development News 🇮🇳

@developmentnewsindia · Post #43849 · 20.04.2026 г., 11:44

The US government has called on the defense contractor V2X to evacuate its employees from Kuwait and Iraq, warning the company that they could be targeted by Iran-backed militias, four sources said. #InternationalNews#NWO https://www.theguardian.com/world/2026/apr/20/defense-contractor-evacuate-iraq-kuwait

Indian Development News 🇮🇳

@developmentnewsindia · Post #43480 · 11.04.2026 г., 20:17

🇺🇸💰💵 US Dollar now represents ~46% of global FX and gold reserves, the lowest in at least 26 years. This percentage has declined -15 points since 2017. Excluding gold, the US Dollar makes up 57% of global reserve currencies, the lowest since 1994, according to IMF data. This comes as central banks have aggressively accumulated gold and diversified into other currencies. The last time the US Dollar fell below 50% of global reserves was in 1990-1991, a period marked by elevated inflation, a recession, and a crisis of confidence in the US economy. #InternationalNews#NWO

Политическая П

@politpe · Post #19932 · 16.02.2026 г., 19:25

🌎#nwo#макро Рэй Далио на Мюнхенской конференции по безопасности: - старый мировой порядок, установленный после 1945 года уже объявлен мертвым большинством мировых лидеров - сейчас мы находимся на «6-м этапе» большого цикла, где нет правил, сила — это право, и великие державы сталкиваются друг с другом - экономические войны обычно предшествуют настоящим войнам, где стреляют - в 1930-е годы были торговые войны, технологические войны, войны капитала и геополитические войны, продолжавшиеся около десяти лет, а потом в 1939 году началась настоящая война mt в max

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