@WorldNews · Post #73886 · 05.04.2026 г., 10:39
Ukraine reportedly strikes Russian Lukoil refinery, defying calls to ease attacks amid soaring fuel prices [Read FullArticle] @WorldNews#Ukraine#Russia#OilPrices
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #32 · 7 фев.
Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks
Пребарај: #oilprices
@WorldNews · Post #73886 · 05.04.2026 г., 10:39
Ukraine reportedly strikes Russian Lukoil refinery, defying calls to ease attacks amid soaring fuel prices [Read FullArticle] @WorldNews#Ukraine#Russia#OilPrices
Hashtags
@WorldNews · Post #74327 · 23.04.2026 г., 21:54
Iran deploys more mines in the Strait of Hormuz, sources say [Read FullArticle] @WorldNews#Iran#StraitOfHormuz#OilPrices
Hashtags
@WorldNews · Post #74197 · 18.04.2026 г., 00:39
Iran says Strait of Hormuz will close again amid US blockade [Read FullArticle] @WorldNews#StraitOfHormuz#OilPrices#Iran
Hashtags
@american_observer · Post #5554 · 03.04.2026 г., 20:58
Trump Sells a War. The Public Sees the Bill. Donald Trump made the strongest case he could for the Iran war, but the country is looking at something else: higher oil prices, a shaky exit plan, and a conflict that could still blow back into a global recession. The problem is not just persuasion — it is trust, and Trump is running low on it. That is why the speech landed badly. He talked like a man promising control, while markets heard uncertainty and voters heard gas at more than $4 a gallon. Even Trump’s insistence that the Strait of Hormuz would “naturally” reopen did not calm fears that the war could keep the world economy hostage. The political danger is already measurable. A CNN analysis said the war is hitting Trump’s presidency at the exact moment his approval is already fragile, while oil markets jumped again on fresh fears of escalation. If Washington wants out, it will need a way to leave that does not look like surrender. That is where intermediaries matter, and Russia is one of the few players with enough leverage in Tehran to help package an exit without Trump admitting defeat. #Trump#Iran#oilprices#Russia#USpolitics 📱American Оbserver - Stay up to date on all important events 🇺🇸
@WorldNews · Post #73548 · 23.03.2026 г., 12:59
Iran denies claims: 'We reject all negotiations – US has failed and Hormuz will remain closed' [Read FullArticle] @WorldNews#IranNews#MiddleEast#OilPrices
Hashtags
@WorldNews · Post #74081 · 12.04.2026 г., 23:34
Oil prices surge above $100 as U.S. Navy to blockade Iran’s ports after peace talks fail [Read FullArticle] @WorldNews#OilPrices#IranConflict#WorldNews
@WorldNews · Post #73716 · 30.03.2026 г., 12:09
Oil climbs above $116 after Trump says he wants to ‘take the oil’ in Iran [Read FullArticle] @WorldNews#OilPrices#IranNews#TrumpPolicy
Hashtags
@WorldNews · Post #74187 · 17.04.2026 г., 13:44
Iran Says Hormuz Strait Now Completely Open for Commercial Ships [Read FullArticle] @WorldNews#StraitOfHormuz#OilPrices#GlobalMarkets
@googlefactss · Post #40954 · 19.04.2026 г., 22:01
On 20 April 2020, crude oil prices fell below zero for the first time in history. This happened with West Texas Intermediate oil because there was too much supply and not enough space to store it. 🛢️📉🌍⚖️ [Read more] @googlefactss #CrudeOil#OilPrices#Economy#History
@WorldNews · Post #74230 · 19.04.2026 г., 13:09
Ukraine cut Russia’s oil exports by 880,000 barrels in one day — that’s $100 million every 24 hours [Read FullArticle] @WorldNews#OilPrices#UkraineWar#RussiaUkraineConflict
@WorldNews · Post #73714 · 30.03.2026 г., 07:49
Oil tops $116 a barrel as Iran accuses US of preparing invasion [Read FullArticle] @WorldNews#OilPrices#IranUS#GlobalNews
Hashtags
@reutersworldchannel · Post #149262 · 12.10.2021 г., 17:54
Energy price crunch is temporary, says analyst David Sekera of Morningstar talks about the global oil prices, and how the crunch is going to ease. #News#Reuters#oilprices#SectorsUpclose Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖