TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #156 · 2 окт.

Те, кто в Python не первый день, хорошо знают, что на число можно умножить не только число, но и другие типы. Главное, чтобы у этих типов была реализация такой операции. # list >>> [1] * 3 [1, 1, 1] # tuple >>> (2, 3) * 3 (2, 3, 2, 3, 2, 3) # string >>> "A" * 3 "AAA" Так работает полиморфизм стандартных типов. Интересно здесь то, что это сработает и в том случае, когда порядок операндов обратный. То есть int умножить на [тип]. # list >>> 3 * [1] [1, 1, 1] # tuple >>> 3 * (2, 3) (2, 3, 2, 3, 2, 3) # string >>> 3 * "A" "AAA" Если хотите реализовать такое поведение в ваших классах то следует помнить два момента: 1. Если множитель справа, то вам нужно реализовать метод __mul__, наш класс это первый операнд, то есть слева. myType * 3 2. Если множитель слева, то вам нужно реализовать метод __rmul__, наш класс это второй операнд, справа. 3* myType Всё тоже самое можно делать и для других математических операторов. И если в этом примере действие и результат будут фактически одинаковыми, то бывают ситуации, когда это не так. Например, при умножении матриц имеет значение порядок операндов. Для других операторов, таких как деление или сдвиг, очень важно кто с какой стороны находится. >>> 2/4, 4/2 (0.5, 2.0) >>> 2<<3, 3<<2 (16, 12) >>> 100%15, 15%100 (10, 15) #tricks#basic

Резултати

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

Пребарај: #buyrating

当前筛选 #buyrating清除筛选
Crypto M - Crypto News

@CryptoM · Post #65143 · 11.04.2026 г., 12:05

🚀 Wall Street Analysts Predict MSTR Stock to Double This Year Most Wall Street analysts anticipate that the stock price of Michael Saylor's company, MSTR, will more than double this year. According to Odaily, the majority of analysts maintain a buy rating, describing it as one of the most undervalued companies globally. #WallStreet#MSTR#StockPrediction#MichaelSaylor#BuyRating#UndervaluedCompanies

Crypto M - Crypto News

@CryptoM · Post #65130 · 11.04.2026 г., 09:03

🚀 TD Cowen Analyst Lowers Target Price for MicroStrategy TD Cowen analyst Lance Vitanza has revised the target price for Bitcoin reserve company MicroStrategy (MSTR) from $440 to $350, while maintaining a buy rating. According to Odaily, this adjustment reflects the analyst's updated assessment of the company's financial outlook. #TDCowen#Analyst#TargetPrice#MicroStrategy#Bitcoin#MSTR#FinancialOutlook#BuyRating#BTC

Crypto M - Crypto News

@CryptoM · Post #64767 · 09.04.2026 г., 20:52

🚀 Analyst Lance Vitanza Initiates Buy Ratings on Three Treasury Companies Lance Vitanza from TD Cowen has initiated coverage on Nakamoto, SharpLink Gaming, and Strive with Buy ratings. According to NS3.AI, Vitanza has set price targets of $1, $16, and $26 for these companies, respectively. He suggests that these treasury firms have the potential to outperform spot crypto exchange-traded products, provided that cryptocurrency prices recover and the companies continue to increase their token holdings per share. #LanceVitanza#TD Cowen #Nakamoto#SharpLinkGaming#Strive#BuyRating#TreasuryCompanies#Crypto#TokenHoldings#PriceTargets#BTC

Crypto M - Crypto News

@CryptoM · Post #65373 · 13.04.2026 г., 02:56

🚀 Daiwa Raises Gu Ming's Target Price to HKD 36 On April 13, according to Jin10, Daiwa released a research report raising the target price of Gu Ming (01364.HK) from HKD 35 to HKD 36, maintaining a 'buy' rating. This corresponds to a forecasted price-to-earnings ratio of 22 times for 2026. Daiwa noted that Gu Ming's takeaway proportion has decreased from a peak of 60% in the third quarter of last year to below 50%. The management expects this trend to continue, aiming to improve franchisee profitability through initiatives such as dine-in promotions, extending morning business hours, and increasing coffee sales. The firm has also raised its earnings per share forecast for Gu Ming from 2026 to 2028 by 6% to 12%. #Daiwa#GuMing#TargetPrice#HKD36#BuyRating#FranchiseeProfitability#EarningsForecast#TakeawayProportion#CoffeeSales#MorningBusinessHours