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

Резултати

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

Пребарај: #romania

当前筛选 #romania清除筛选
POPULAR FRONT

@popularxfront · Post #4196 · 18.12.2025 г., 23:46

🇷🇴#Romania: Archival footage from the Romanian Revolution of December 1989 captures armed clashes between rebels, government forces, and so-called terrorists. The uprising began in Timișoara after authorities attempted to evict Hungarian pastor Tőkés, sparking protests that escalated nationwide. The regime responded by ordering live fire against civilians, resulting in hundreds of deaths. However, parts of the army switched sides, and after Ceaușescu’s control collapsed (Communist Romania's leader), authorities claimed the country was under attack by foreign agents. Chaos ensued, with armed civilians, Securitate agents (Romanian KGB), and army units clashing, leading to friendly fire and panic, with passersby often labeled as terrorists. The violence subsided rapidly after Ceaușescu’s execution and consolidation of power by the National Salvation Front. The alleged terrorists vanished, gunfire declined, and investigations stalled. To this day, the true elements responsible for the deaths remain unknown.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1705 · 31.03.2026 г., 12:14

Romania🇷🇴 ✅ Romania is a classic European country known for its beautiful beaches, stunning nature, and famous ski resorts. If you prefer a calm and relaxed vacation, this is a great option. ✅ While Romania may not be the wealthiest country in Europe, interest in it has significantly grown in recent years. With plenty of sunshine, clear seas, and beautiful mountains, it offers many attractions. Highlights include well-preserved medieval castles and picturesque national parks. #Romania | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1173 · 24.11.2024 г., 13:14

ROMANIA🇷🇴 ✅ Romania is a classic European country known for its beautiful beaches, stunning nature, and famous ski resorts. If you prefer a calm and relaxed vacation, this is a great option. ✅ While Romania may not be the wealthiest country in Europe, interest in it has significantly grown in recent years. With plenty of sunshine, clear seas, and beautiful mountains, it offers many attractions. Highlights include well-preserved medieval castles and picturesque national parks. #Romania @voyage

Hashtags

BAZUKA

@jbazuka · Post #116 · 07.07.2022 г., 05:53

🇷🇴#RomaniaНа западе Румынии горит пшеничное поле ⚠️☝️ 💬 Огонь охватил около 100 га. Причиной, предположительно, стала сильная жара: последние дни температура воздуха тут достигает +40 °С. 💬 Местные предполагают, что на самом деле это спланированное уничтожение пшеничного поля, чтобы создать искуственный голод!

Hashtags

Interesting Planet 🌍

@interesting_planet_facts · Post #1230 · 17.01.2026 г., 12:11

🌎 Deep inside Romania’s Apuseni Mountains, the Scarisoara Ice Cave contains one of the oldest and largest underground glaciers in the world. The ice block is over 3,500 years old and reaches about 26 meters thick. ✨ #caves⚡#geology⚡#Romania 👉subscribe Interesting Planet 👉more Channels ​

POPULAR FRONT

@popularxfront · Post #5150 · 27.02.2026 г., 19:48

🇺🇦#Ukraine / 🇷🇴#Romania - 🇷🇺#Russia: Footage shows a Russian Shahed drone being shot down by Ukrainian air defence over the Danube River in Odesa Oblast this morning. The video was filmed from the Romanian side of the border, showing just how close these drones are flying next to neighbouring countries. Over the past years, there have been multiple incidents of such drones crashing into Romanian territory. (📹 via @Archer83Able on X)

Tutto Elezioni

@tuttoelezioni · Post #999 · 18.05.2025 г., 18:29

#Romania🇷🇴 #Presidenziali 🕗Ore 20:00 italiane (21:00 ora locale). Affluenza parziale (dati interni ed esteri): 64,72% (+11,51% rispetto al primo turno). Affluenza parziale (solo dati interni): 55,57% (+7,77% rispetto al primo turno). @TuttoElezioni

123•••10•••1415
ПретходнаСтраница 1 од 15Следна