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

Резултати

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

Пребарај: #transparency

当前筛选 #transparency清除筛选
PizzApp Design - Wallpapers & Icon Packs

@pizzapp_design · Post #7729 · 14.05.2026 г., 10:50

♾️#Transparency#IconPack Limited Time SALE 🎉 📲 Codes WLH0A5YS6KL0M6MMAWXH9NZ 6Y3T4E6KJTW3BPSQ40GB2X7 7KX00KFBLVMEHMS7JCX8DVU GDX1LQ8SARD78Q85MR51WPC STBJNPFEP3QNBE0XYVKVYZN FYLFUE2ZPW2MMBP2Q9S9TTF KJSEPH59SDYGAM9T28Q7Z9G NFTCRKMP8057CL9054DAT2Q 1M6PDFEXWHL0EW80P2AMNHU 09BBT4LBN8048BK0H68WH6D 🖥Download Here ⭐️Rate & Review to support me!

America 🇺🇸 News & Politics

@America · Post #10401 · 20.03.2026 г., 13:03

🚨💰IRS GLITCH HIDES $51M IN POLITICAL DONATIONS 🔹 Technical error masks campaign contributions to state-level groups for Q4 2025 📊 🔹 Republican Attorney General's Association, RSLC affected - $41M in donations missing 💸 🔹 IRS workforce cut 27% by DOGE efficiency drive - system failures mounting rapidly 🏛️ 🔹 527 organizations face April 15 deadline with completely broken e-filing system ⏰ 🔹 Center for Political Accountability warns of "complete black hole" in transparency 🕳️ 🔹 Affected groups include RGA ($32M), DLCC - major election funding obscured 📋 The most transparent democracy? More like broken bureaucracy failing voters 😤🇺🇸 #USNews#politics#transparency @america

AI & Law

@ai_and_law · Post #308 · 16.05.2024 г., 07:04

Microsoft Touts Responsible AI Efforts in New Report Microsoft released a comprehensive report, the "Responsible AI Transparency Report," detailing its initiatives for developing and deploying responsible Artificial Intelligence technologies. The report highlights Microsoft's commitment to building safe and responsible generative AI, a field where the company has actively pursued innovation. Microsoft emphasizes its safety efforts, including: ✅ Launching over 30 tools to empower developers with responsible AI practices. ✅ Providing more than 100 features within Azure to assist customers in deploying safe AI solutions. ✅ Expanding its responsible AI community by 17%, now exceeding 400 members. ✅ Mandating responsible AI training for all employees, with a 99% completion rate for relevant modules. The report concludes with a commitment from Microsoft to invest further in responsible AI development tools for its customers. #ResponsibleAI#Transparency

AI & Law

@ai_and_law · Post #593 · 17.06.2025 г., 07:04

🇺🇸When “AI-First” Means 700 Humans Behind the Curtain BuilderAI, a Microsoft-backed startup once hailed as a pioneer in “AI-powered app creation,” has reportedly gone bankrupt — and not for lack of demand. While the company promoted itself as using artificial intelligence to automate software development, recent revelations show that it relied heavily on a workforce of 700 people in India to do the work manually. #AI ##ResponsibleAI#Transparency

123•••56
ПретходнаСтраница 1 од 6Следна