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

Резултати

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

Пребарај: #broadcom

当前筛选 #broadcom清除筛选
DOFH - DevOps from hell

@dofh_ru · Post #3569 · 05.02.2025 г., 17:32

Напоминание владельцам и админам несвежих продуктов Brocade End-of-Support, Brocade 6505 Switch: April 30, 2025 End-of-Support, Brocade 6510 Switch: June 17, 2025 и тд Начиная с версии FOS 8.2.2 в эти даты отключается часть функционала. Рекомендация - откатиться/оставаться на 8.2.1e #Broadcom#Network#Switch#EOS

Crypto M - Crypto News

@CryptoM · Post #64944 · 10.04.2026 г., 11:49

🚀 AI TRENDS | Anthropic Secures CoreWeave Data Center Capacity Amid Rising AI Demand Anthropic has agreed to lease data center capacity from CoreWeave to address the growing demand for its AI services, Jin10 reports. CoreWeave announced on Friday that the multi-year agreement will assist Anthropic in building and deploying its Claude AI model. CoreWeave's CEO, Intrator, stated that the deal will involve various Nvidia chip architectures within U.S. data centers. The financial terms of the agreement were not disclosed by either company. Anthropic, similar to OpenAI, has been at the forefront of the AI service surge, sometimes struggling to maintain its products online due to what it describes as 'unprecedented demand.' Earlier this week, Anthropic revealed a collaboration with Broadcom and Google to secure 3.5 gigawatts of energy, noting that one gigawatt of power is sufficient to supply electricity to approximately 750,000 U.S. households simultaneously. #AI#Anthropic#CoreWeave#DataCenter#ClaudeAI#Nvidia#Broadcom#Google#ArtificialIntelligence#TechTrends

Venture Village Wall 🦄

@venturevillagewall · Post #3438 · 19.12.2024 г., 07:06

Major Moves in Tech and AI 🔹Avito acquires two advertising services: AdRiver and Soloway; no deal amount disclosed but estimates range from 0.5-2.5 billion rubles. More on this from RBC. 🔹Perplexity raises $500M at a $9B valuation. The AI startup specializes in delivering prompt answers to users. Previous valuation was at $3B; read more on Bloomberg. 🔹 Formerly known as TuSimple, the self-driving truck company rebrands to CreateAI, focusing on AI for video games after abandoning its trucking ambitions. Article on CNBC. 🔹 Ex-investment director of RUSNANO, Nail Gubaev, under investigation for alleged embezzlement, signs contract with the Ministry of Defense, prompting a suspension of prosecution. Details in Kommersant (link). 🔹 Insights from Smart Ranking show Russia’s medtech market grew 40% in Q3, with companies like Steplife (+258.5%) and Motorika (+190.95%) leading the growth in prosthetics. More info here: Kommersant. 🔹Broadcom reports a 220% revenue rise, solidifying its status as a $1 trillion company amidst soaring chip demand for AI. Read more on Business Insider. #Avito#Advertising#Funding#AI#Perplexity#TuSimple#CreateAI#MedTech#Prosthetics#Broadcom#RevenueGrowth#NVIDIA#Embezzlement#TechNews#Startups#China#MarketTrends#Innovation#Investments#MarketValuation#TechAcquisition