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

Резултати

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

Пребарај: #greenland

当前筛选 #greenland清除筛选
International Geographic

@internationalgeographic · Post #5476 · 06.03.2025 г., 18:48

#Greenland🇬🇱 Eternal ice 🧊 Would you like to visit here? About 80% of the territory of Greenland is covered with an ice shield, which is the second largest in the world after Antarctica. The ice in some places reaches a thickness of up to 3 km. Greenland cuisine is based on the gifts of nature: fish, seafood, venison and dishes from marine mammals. For example, "Suasat" - sewen soup - is considered a traditional dish.

Hashtags

MAJOR

@major_auto_official · Post #4052 · 14.01.2026 г., 11:06

Отвлечемся на секунду от новостей автопрома и поговорим чуть о том, что в мире нет стабильности. Суматошный нестабильный эксцентричный президент США хочет заграбастать Гренландию. В одном из своих интервью он сказал, что армия Гренландии состоит из двух собачьих упряжек. Гордые жители создали шедевральный ии-шный ролик (точно пару дней потратили) в котором продемонстрировали свои военные возможности. У них есть собаки, моржи и пингвины (почему-то в форме образца СССР). Что мы вообще думаем об этой ситуации. Заберет или не заберет? Заберет - 👎 Не заберет - 👍 Вообще это какая то дичь - 🥴 Ролик огонь - ❤️ #greenland

Hashtags

Crypto Pump Club 📈

@cryptoclubpump · Post #1950 · 22.01.2026 г., 09:07

#GREENLAND RESULT ————————— PEAK: 1,109% If you think that was a great move, you haven't seen what we have planned for our next launch... After giving it to you guys, we pushed #GREENLAND over 1,100% in a matter of less than an hour, destroying our target and guaranteeing the biggest profits for our members. Trump is about to move the global economy again, and we're about to have the biggest 100x opportunity we've had in years. We're just getting started Stay tuned.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1520 · 04.08.2025 г., 12:14

👣 The iceberg's breath in northeast Greenland. Silence and icy expanses where every breath feels like nature itself. 📏 📏 📏 📏 📏 📏 📏 📏 #Greenland | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1448 · 12.06.2025 г., 12:14

👣 The iceberg's breath in northeast Greenland. Silence and icy expanses where every breath feels like nature itself. 📏 📏 📏 📏 📏 📏 📏 📏 #Greenland🇬🇱@voyage

Hashtags

Crypto Pump Club

@crypto_bitcoin_pumps_signal · Post #1417 · 22.01.2026 г., 09:10

#GREENLAND RESULT ————————— PEAK: 1,109% If you think that was a great move, you haven't seen what we have planned for our next launch... After giving it to you guys, we pushed #GREENLAND over 1,100% destroying our target and guaranteeing the biggest profits for our members. Trump is about to move the global economy again, and we're about to have the biggest 100x opportunity we've had in years. We're just getting started Stay tuned.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1376 · 01.04.2025 г., 12:14

👣 The iceberg's breath in northeast Greenland. Silence and icy expanses where every breath feels like nature itself. 📏 📏 📏 📏 📏 📏 📏 📏 #Greenland🇬🇱@voyage

Hashtags

Trump's Ear

@trumpsear_tg · Post #2053 · 26.01.2026 г., 14:03

The United States abandoned the idea of seizing Greenland due to the threat of impeachment to Trump, - Reuters #Trump#Greenland 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #2049 · 23.01.2026 г., 20:59

The world would be a “better, more secure place” if America took over Greenland, Nigel Farage said at Davos, while insisting that he still believed in the sovereignty of nation states. During a panel at the World Economic Forum’s “America House” in the Swiss ski resort on Wednesday, the Reform UK leader said he had “no doubt” that the world would be safer if a “strong America” was in Greenland “because of the geopolitics of the high north, because of the retreating ice caps and because of the continued expansionism of Russian icebreakers, of Chinese investmen #Trump#Greenland 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #2005 · 14.01.2026 г., 17:59

The United States needs Greenland for national security reasons, Trump said. According to the US president, the island is important for the creation of the Golden dome system. And NATO is supposed to pave the way for America to get Greenland. #Trump#Greenland 👂More on Trump's Ear ⚠️

123•••78
ПретходнаСтраница 1 од 8Следна