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

Резултати

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

Пребарај: #epiphany

当前筛选 #epiphany清除筛选
Addis Standard

@addisstandardeng · Post #21111 · 19.01.2026 г., 10:21

In_Pictures: #Epiphany celebrations across #Ethiopia Epiphany (Timket) celebrations are taking place across Ethiopia, as followers of the Ethiopian Orthodox Tewahedo Church mark the festival in accordance with long-standing religious traditions. Observances began on the eve of the Katara ceremony yesterday, with clergy and congregants participating in the commemoration. Photo: Social media

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40485 · 06.01.2026 г., 03:04

January 6 is Epiphany or Theophany. Wise Men, or magi, visited baby Jesus with gifts: gold, frankincense, and myrrh. The Bible doesn’t say how many magi came or their names; tradition says three: Melchior, Caspar, and Balthazar. Some churches also celebrate Jesus’ baptism this day. Before December 25 was Christmas, January 6 was the main day to celebrate Jesus’ birth. It ends the 12 days of Christmas with food, parades, and gifts. ✝️🎁⭐ [Read more] We wish you all a happy Epiphany day. @googlefactss#Epiphany#Jesus#Christmas#ChristianTraditions#History

☦️Epiphany and the Cross-Diving Tradition On the feast of the Epiphany, believers in a number of countries take part in a folk-religious tradition known as cross diving. 🔹 After the blessing of the water, a priest throws a cross into a body of water — a river, lake, or the sea. 🔹 Participants then swim to retrieve the cross from the water. 🔹 It is believed that the person who retrieves the cross first receives a special blessing for the year ahead. 🌍 This tradition is especially common in countries with a warmer climate than Russia, such as Greece, Bulgaria, Serbia, as well as in several other countries and regions. 🇷🇺🇿🇦 This tradition is also practiced within the Russian-speaking diaspora in South Africa. 📸Photo (Cape Town) 🔗Source: https://t.me/Capetown_SouthAfrica_chat/50655 #Epiphany#Orthodoxy#ChristianTraditions#Culture#Religion#FolkTraditions#SouthAfrica#CapeTown

Addis Standard

@addisstandardeng · Post #21118 · 19.01.2026 г., 13:37

In Pictures 2 #Ethiopians across the country celebrate Timket (#Epiphany)—recognized by #UNESCO as an intangible cultural heritage of humanity—one of the Ethiopian Orthodox Church’s most sacred festivals, marked by vibrant processions, prayers, and communal gatherings. On the occasion of the festival, various embassies in Addis Abeba have extended congratulatory messages. The embassies of #Russia and the #United_States, along with those of #Germany, the #Netherlands, the #United_Kingdom, #Switzerland, #Sweden, #Finland, #Israel, #Armenia, #Canada, #Iran, #Pakistan, and #Australia, wished Ethiopians a peaceful and joyful celebration. (Source: FBC, TigTV)