@all_bts_updates · Post #109374 · 13.09.2025 г., 14:41
CORTIS sings happy birthday to #RM during his live on Weverse ! -@All_BTS_Updates
Hashtags
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
Пребарај: #rm
@all_bts_updates · Post #109374 · 13.09.2025 г., 14:41
CORTIS sings happy birthday to #RM during his live on Weverse ! -@All_BTS_Updates
Hashtags
@all_bts_updates · Post #108972 · 24.08.2025 г., 14:16
📊 CHARTS] "Indigo" by #RM now hits 900 Million streams on Spotify...! CONGRATULATIONS NAMJOON CONGRATULATIONS RM -@All_BTS_Updates
Hashtags
@OUR_7_PRINCES · Post #114719 · 19.07.2025 г., 16:44
#RM at the wedding of Kim Youngjin and Lee Hajeong in Seoul. #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #114718 · 19.07.2025 г., 16:43
Tae Hoon Lee (Nike’s Korea Marketing Director) shared a picture of #RM with J-Hope and Suga at the wedding. #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #113788 · 18.06.2025 г., 23:41
#RM in his session talk for Samsung Art TV at Art Basel. #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #113780 · 18.06.2025 г., 23:41
#RM spotted at Art Basel's Messeplatz in Switzerland. #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #113774 · 18.06.2025 г., 23:41
#RM spotted at Art Basel's Messeplatz in Switzerland. #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #113772 · 18.06.2025 г., 23:26
#RM via Amalia Wirjono (Museum MACAN's Head of Development) instagram. https://www.instagram.com/p/DLDS91PTkYX/?igsh=aGU2ZXc2bGk2cGw2 #INFO •@OUR_7_PRINCES•
@OUR_7_PRINCES · Post #115031 · 01.08.2025 г., 08:42
RM INSTAGRAM STORY UPDATE 💜 Translation Weren’t you curious? You must have been very curious. But writing is something you keep doing because you think you can’t help it, even if you won’t become a good writer. They probably kept writing, and by doing so, they became writers. Now they are probably getting asked the same question I get: ‘Did you always think you’d become a writer?’ If you live like a useless boat drifting with the tide, you eventually arrive somewhere. That is the future. And it comes even if you do nothing. When you finally reach that future, there is something everyone does—rewrite the preface of the past to match the ending [this quote is from a book. It’s attributed to Kim Young-ha (김영하) and appears in his novel A Single Life (단 한 번의 삶) .] #RM | #INSTAGRAM •@OUR_7_PRINCES•
Hashtags
@OUR_7_PRINCES · Post #114745 · 21.07.2025 г., 14:52
RM INSTAGRAM POST UPDATE 💜 🐨: nonchalant #RM | #INSTAGRAM •@OUR_7_PRINCES•
Hashtags
@OUR_7_PRINCES · Post #114717 · 19.07.2025 г., 16:42
Artist Yoon Jiyong shared this picture of #RM on instagram story. #INSTAGRAM •@OUR_7_PRINCES•
Hashtags
@OUR_7_PRINCES · Post #114715 · 19.07.2025 г., 16:42
#RM via rkive repost: 1. Eyes Magazine editor Jin Pyo: “Kim euri @ rkive You’re really a good host/MC.” 2. Post Archive Fasion Creative Director Lim Dongjoon: “You're the best MC/host I've ever seen...” #RM | #INSTAGRAM •@OUR_7_PRINCES•
Hashtags