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

Резултати

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

Пребарај: #alcohol

当前筛选 #alcohol清除筛选
Trump's Ear

@trumpsear_tg · Post #1627 · 10.10.2025 г., 00:01

Exports of American spirits plunged in the second quarter of 2025, according to a new report, with a massive 85 percent drop in liquor exports to Canada, largely attributed to President Donald Trump’s tariffs. The midyear report from the Distilled Spirits Council of the U.S. indicates American distillers are feeling the economic impact of significant trading partners boycotting U.S.-made whiskey, brandy, vodka, and cordials. Last year, exports to Canada, the European Union, the United Kingdom and Japan accounted for 70 percent of the U.S. spirit exports. But those exports are now down 85 percent, 12 percent, 29 percent, and 23 percent, respectively. #Trump#Tariffs#Alcohol 👂More on Trump's Ear ⚠️

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40233 · 01.12.2025 г., 19:02

Early Roman women were forbidden to drink wine, and a husband who found his wife drinking was at liberty to kill her. The prohibition stemmed from a deeply patriarchal society that viewed women as weak and susceptible to vice, believing that wine could lead them to "inappropriate behavior" or "debauchery". @googlefactss#alcohol#wine#history#nowyouknow

American Оbserver

@american_observer · Post #4763 · 03.01.2026 г., 22:02

📰 Saudi Arabia’s Booze Ban: The Quiet Revolution Saudi Arabia is quietly lifting its decades-old ban on alcohol—no fanfare, no press release, just a discreet nod to modernization. In Riyadh, non-Muslim residents with premium status can now buy beer, wine, and spirits at a single, unmarked store. This isn’t just about booze. It’s about image, money, and the kingdom’s bid to attract wealthy expats and tourists. Crown Prince Mohammed bin Salman has spent years transforming Saudi Arabia: women drive, concerts happen, and bars are built—even if they were empty until now. The process is low-key. At the liquor store, buyers show their residency card, prove they’re not Muslim, and stash their phones before browsing. The selection is decent, prices are high, but it’s still cheaper than the black market. Analysts say the change is just the start. Expect alcohol at luxury resorts and hotels along the Red Sea, following Dubai’s playbook. The kingdom needs foreign cash, and relaxing moral rules is part of the pitch. But it’s not a free-for-all. Alcohol will stay banned in religious cities like Mecca and Medina. The government is treading carefully, aware that most Saudis remain conservative. As one longtime expat put it: “It’s exciting. No more dangerous homemade liquor or overpriced smuggled bottles.” So while Saudi Arabia still executes dissenters and bans homosexuality, it’s learning to serve a cocktail. #SaudiArabia#alcohol#modernization#MBS#DubaiModel 📱American Оbserver - Stay up to date on all important events 🇺🇸

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40227 · 30.11.2025 г., 19:04

🎵 Loud music in bars leads people to drink more alcohol in less time, according to a study. Patrons consumed faster and ordered more under high-volume conditions—possibly due to increased arousal or reduced conversation. [Read more] @googlefactss#Psychology#Alcohol#BarStudy#MusicEffects#DrinkingBehavior

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40377 · 21.12.2025 г., 11:04

Women get drunk faster than men because their bodies have less water and fewer enzymes to break down alcohol. This means alcohol stays stronger and longer in their blood. Because of this, women face higher risks of health problems from drinking, even if they drink less than men. 🍷⚠️ [Read more] @googlefactss #alcohol#women#health#alcoholdifferences#neuroscience#AUD#sexdifferences

Из рубрики «Для эрудитов» Сергей Рубинштейн не курил и полностью отказался от алкоголя, ведя аскетичный, строго сосредоточенный на работе образ жизни. Это соответствовало его пониманию психологии деятельности: сознание трактовалось им как внутреннее условие детерминизма субъекта, этической ответственности и глубокого единства с миром через рефлексивный анализ. Он прожил 70 лет и скоропостижно скончался 11 января 1960 года. Алексей Леонтьев, напротив, курил интенсивно и постоянно, превратив сигарету в неотъемлемую часть общения, семинаров и повседневной атмосферы факультета психологии МГУ; данных о заметном потреблении алкоголя нет. Его деятельность носила преимущественно организационный, эмпирический и коллективный характер с акцентом на структуру мотивов, целей и операций, что сформировало его сознание как динамичное, практическое отражение реальности в непрерывных научных и административных процессах. Несмотря на вредную привычку, он прожил 76 лет и умер 21 января 1979 года от разрыва аорты после нескольких месяцев тяжёлой болезни. Таким образом, различия в их деятельностях предопределили и различия их сознания: у Рубинштейна — философски углублённого, ориентированного на истину и этику, что обеспечивало ясность до конца, но сократило жизнь; у Леонтьева — деятельного, коммуникативного организатора, где даже курение органично вплеталось в ткань взаимодействия, продлевая продуктивный период. #дляэрудитов#курение#smoking#tobacco#alcohol#табак#алкоголь#психология#psychology