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

Резултати

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

Пребарај: #phone

当前筛选 #phone清除筛选
KOMPYUTER AKADEMIYASI

@Kompyuter_Akademiyasi · Post #6371 · 18.06.2024 г., 17:00

Tech quiz master #phone ℹ️ Ham IT ni ham ingliz tilini o'rganaman deganlar uchun mobil dastur (android). Ancha vaqtlar bu dastur pullik edi, bugun bepul turibdi! ✅ Ushbu dasturda turli darajalarda IT va kompyuter sohasiga oid testlarni ishlaysiz. Faktlar bo'limida esa faktlarni ko'rishingiz mumkin. ⬇️Play Marketdan yuklash 💻 Kompyuterni birga o'rganamiz ⤵️ 🛫Telegram I 📺YouTube

Hashtags

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24152 · 27.04.2026 г., 07:01

【🚀 交易市場|郭明錤:OpenAI 要做 AI Agent 手機,聯發科、高通、立訊成關鍵供應鏈 】 #OpenAI#Phone 📍 請見報導: https://abmedia.io/openai-ai-agent-phone-qualcomm 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

Libreware

@libreware · Post #1068 · 02.05.2022 г., 02:23

Red Redirect outgoing calls to Signal/Telegram/Threema. Tiny app to redirect outgoing calls to Signal/Telegram/Threema if available. You can cancel redirection by clicking on "Redirecting to.." popup. Download - https://github.com/x13a/Red/releases https://github.com/x13a/Red #new#phone @foss_Android

Hashtags

Home decor

@dzdigital3 · Post #18851 · 12.08.2025 г., 21:36

UNIWA X28 Old Man Flip #Mobile#Phone GSM Senior Big Push-Button Flip Phone Dual Sim FM Radio Price 24€ Place your order https://s.click.aliexpress.com/e/_EwCPskl

Libreware

@libreware · Post #1479 · 03.09.2025 г., 22:47

#bootloader unlock wall of shame https://github.com/melontini/bootloader-unlock-wall-of-shame updated guide, check it before buying a #phone Over the past few years, a suspicious number of companies have started to "take care of your data", aka block/strictly limit your ability to unlock the bootloader on your own devices. While this may not affect you directly, it sets a bad precedent. You never know what will get the axe next: Shizuku? ADB? Sideloading? I thought it might be a good idea to keep track of bad companies and workarounds. #android

Addis Standard

@addisstandardeng · Post #21346 · 09.02.2026 г., 08:28

Residents report #phone, #internet#outages in #North_Shewa Zone, leaving families struggling to stay connected Residents in several districts of North Shewa Zone of the #Oromia region say recent disruptions to mobile phone and internet services have left families unable to communicate, heightening concerns among civilians and students struggling to reach relatives in affected areas. Residents who spoke to Addis Standard said the communication disruption began weeks ago and has made it difficult to obtain information about the safety and well-being of family members. This is not the first time communication blackouts have affected the North Shewa Zone. In 2024, residents also reported data outages and network disruptions across parts of the zone in the Oromia region, with some saying the communication blackout persisted for nearly two months amid ongoing insurgency-related security concerns. https://addisstandard.com/?p=55093