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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #83 · 11 мај

У строки в Python есть два очень похожих метода. На столько похожих что кажется они делают одно и тоже. Это метод isdigit() и isnumeric() Давайте посмотрим зачем нам два одинаковых метода? И так ли они одинаковы? Очевидно что isdigit() говорит нам, состоит ли строка только из чисел 0-9 >>> '12'.isdigit() True >>> '12x'.isdigit() False >>> '-12'.isdigit() False >>> '12.5'.isdigit() False Можно предположить что isnumeric() делает более глубокий анализ и распознаёт в строке float или отрицательное число. >>> '15'.isnumeric() True >>> '-15'.isnumeric() False >>> '15.2'.isnumeric() False Нет, всё так же как и с другим методом. В чем же тогда разница? Для начала посмотрим следующие примеры: >>> '5'.isdigit(), '5'.isnumeric() # Обычная цифра 5 # True, True >>> '꧕'.isdigit(), '꧕'.isnumeric() # Яванская 5 # True, True >>> '෩'.isdigit(), '෩'.isnumeric() # Синхала 3 # True, True >>> '৩'.isdigit(), '৩'.isnumeric() # Бенгальская 3 # True, True >>> '༣'.isdigit(), '༣'.isnumeric() # Тибетская 3 # True, True >>> '³'.isdigit(), '³'.isnumeric() # 3 верхний индекс (степень) # True, True >>> '𝟝'.isdigit(), '𝟝'.isnumeric() # Математическая двойная 5 # True, True >>> '๔'.isdigit(), '๔'.isnumeric() # Тайская 4 # True, True >>> '➑'.isdigit(), '➑'.isnumeric() # 8 в круге # True, True А теперь примеры в которых, по мнению Python, результаты не равны >>> '¾'.isdigit(), '¾'.isnumeric() # дробь три четверти # False, True >>> '⅕'.isdigit(), '⅕'.isnumeric() # дробь одна пятая # False, True >>> '𒐶'.isdigit(), '𒐶'.isnumeric() # клинопись 3 # False, True >>> '三'.isdigit(), '三'.isnumeric() # 3 из унифицированной идеограммы # False, True >>> '⑩'.isdigit(), '⑩'.isnumeric() # цифра 10 в круге # False, True >>> 'Ⅳ'.isdigit(), 'Ⅳ'.isnumeric() # Римская 4 # False, True >>> '𑇪'.isdigit(), '𑇪'.isnumeric() # Сенегальская архаическая 10 # False, True >>> '𐌢'.isdigit(), '𐌢'.isnumeric() # Этрусская цифра 10 # False, True >>> 'ↂ'.isdigit(), 'ↂ'.isnumeric() # Римская цифра 10000 # False, True >>> '〇'.isdigit(), '〇'.isnumeric() # Символ ККЯ ноль # False, True Получается, что isdigit() говорит нам, является ли символ десятичной цифрой или спецсимволом, имеющим цифирное значение после преобразования. В свою очередь isnumeric() включает все дополнительные символы юникода которые имеют отношения к числовым и цифровым представлениям. Ну и пара примеров в которых в обоих случаях символ не является числом, это эмодзи. >>> '🕙'.isdigit(), '🕙'.isnumeric() # эмодзи 10 часов # False, False >>> '7️⃣'.isdigit(), '7️⃣'.isnumeric() # эмодзи 7 # False, False Также есть еще один дополнительный и весьма полезный метод isdecimal(). Он нам сообщает, можно ли из указанного символа сделать простую десятичную цифру. То есть сработает ли метод int(x) >>> '෩'.isdecimal(), int('෩') # Синхала 3 # True, 3 >>> '➑'.isdecimal(), int('➑') # 8 в круге # False, ValueError Какие выводы? 🔸 При определении цифры в строке isdigit() подходит лучше чем isnumeric(), но оба не гарантируют успешную конвертацию в int 🔸 Для однозначного определения возможности преобразования строки в int лучше подходит метод isdecimal() 🔸 Для однозначного определения символов 0...9 лучше использовать regex Полный список символов юникода которые определяются как numeric #basic

Hashtags

Резултати

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

Пребарај: #justinsun

当前筛选 #justinsun清除筛选
SpotOnChain | Announcement

@spotonchain · Post #907 · 14.07.2024 г., 01:23

9 hours ago, Justin Sun allegedly withdrew 14,436 $ETH (~$45.5M) from #Binance. 3 days ago, he deposited 45M $USDT to the CEX; therefore, this time's purchasing price was ~$3,117. Overall, since Feb 8, he might have bought 377,188 $ETH at ~$3.049 via 3 wallets and now has an unrealized profit of over $50M (+4.4%). Follow @spotonchain and set alerts for more updates about #JustinSun via https://platform.spotonchain.ai/en/platform/entity/278

SpotOnChain | Announcement

@spotonchain · Post #854 · 10.06.2024 г., 06:44

Justin Sun (@justinsuntron) deposited $21M worth of 4 assets to #Binance in the past 30 minutes, including: • 93,979 $AAVE ($11.26M) • 3,800 $MKR ($9.3M) • 4,178 $COMP ($245K) • 203,623 $LQTY ($217K) Follow @spotonchain and set alert for #JustinSun entity on our platform nowz https://platform.spotonchain.ai/en/entity/278

SpotOnChain | Announcement

@spotonchain · Post #944 · 05.08.2024 г., 09:33

How much did your portfolio drop today? Justin Sun took a hit of ~$280M as #Ethereum nosedived by 20%! Since Feb 8, 2024, he reportedly accumulated 377,590 $ETH (est. cost: $1.15B) via 3 wallets. But now $ETH is trading well below his average buying price of $3051! Still, Justin Sun hasn’t been liquidated yet! Follow @spotonchain and monitor the #JustinSun entity via https://platform.spotonchain.ai/en/entity/278

SpotOnChain | Announcement

@spotonchain · Post #946 · 06.08.2024 г., 01:27

Justin Sun (@justinsuntron) withdrew 14,884 $ETH ($35.97M) from #Binance 10 hours ago! This brought the total amount of $ETH he accumulated since Feb to 392,474 $ETH (est. cost: $1.19B, now worth: $995M). Note that Justin Sun also deposited a net amount of 49M $USDT to #HTX in the past 3 days. More $ETH purchases? Follow @spotonchain for more updates about #JustinSun now at https://platform.spotonchain.ai/en/platform/entity/278

SpotOnChain | Announcement

@spotonchain · Post #862 · 18.06.2024 г., 01:51

15 hours ago, Justin Sun (@justinsuntron) deposited another $14M in 8 assets to #Binance, including: • 3.45M $ETHFI ($12.05M) - claimed from the airdrop 3 months ago. • 6.23M $CRV ($1.96M) - of which 5M $CRV was purchased from Curve founder Michale Egorov at an OTC price of $0.4 last Aug. • and $333K in 6 other tokens $CVX, $MATIC, $GAL, $WOO, $PROS and $TRU. Overall, in the past week, Justin Sun has deposited $35M in 12 tokens, mostly #DeFi ones, to Binance. Follow @spotonchain and set alert for #JustinSun entity on our platform now: https://platform.spotonchain.ai/en/entity/278

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24049 · 22.04.2026 г., 06:00

【🚀 交易市場|不滿代幣遭凍結!TRON 創辦人孫宇晨對川普家族 WLFI 提告 】 #JustinSun#WLFI 📍 請見報導: https://abmedia.io/tron-justin-sun-sue-trump-wlfi 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

SpotOnChain | Announcement

@spotonchain · Post #957 · 10.08.2024 г., 18:44

Justin Sun transferred 500 $BTC ($30.3M) to a #Binance deposit and 513.4 $BTC ($31.2M) to a new wallet in the past hour. So far in 2024, he has deposited a net amount of 2,969 $BTC ($164M) to #HTX and #Binance at ~$55,185. Notably, Justin Sun often claims to be a strong advocate of #Bitcoin: • In late February, he revealed an HTX account holding 28,614 $BTC (now $1.74B). • In July, he offered to buy all $BTC off-market from the German government to minimize market impact. • However, also in July, he denied going long on $BTC at the $69,000 price level. Follow @spotonchain for more updates about #JustinSun now via https://platform.spotonchain.ai/en/platform/entity/278

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24364 · 05.05.2026 г., 05:32

【🔗 DeFi|孫哥槓上川普家族!孫宇晨遭 WLFI 反訴誹謗,直批「公關作秀」】 #WLFI#JustinSun#Trump 波場創辦人週二遭佛州法院起訴,指控其索要封口費不成後發動報復。 他斥資 1.75 億美元入局,現因 2.4 億代幣凍結遭控違反 2025 年清晰法案。昔日盟友反目,對決凸顯政治品牌與幣圈大亨的利益摩擦。 📍閱讀全文: https://abmedia.io/trump-affiliated-world-liberty-sues-justin-sun 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

华人社

@hrtt · Post #3095 · 22.04.2026 г., 15:59

😁 😁 😁 🚨 突发:币圈大佬彻底开战!孙宇晨反击特朗普关联公司:指控其“敲诈勒索”!💥 币圈又变天了! 波场(TRON)创始人孙宇晨(Justin Sun)正式提起诉讼,矛头直指与美国前总统特朗普有千丝万缕联系的加密货币公司 World Liberty Financial (WLF)! 孙宇晨指控该项目并非普通的商业合作,而是一场精心策划的“敲诈勒索”! 孙宇晨声称由于对方的违规操作和蓄意误导,导致其旗下公司遭受了高达数亿美元的惨重损失!📉💸 “我们不会对这种赤裸裸的掠夺行为坐视不管!” 🔥孙宇晨 vs 特朗普关联项目,这不仅是商业纠纷,更是顶级流量与政治背景的跨界大混战!🥊 诉讼文件揭露了多项不为人知的交易细节,直指对方利用特朗普的影响力进行“收割”。🤫 随着诉讼爆出,相关代币价格出现剧烈波动,引发全网投资者恐慌!📊🔥 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁这是又要搞什么跨世纪营销? #孙宇晨#特朗普#加密货币#WLF#敲诈勒索#币圈大地震#JustinSun 😀一键订阅 😀助推频道

12
ПретходнаСтраница 1 од 2Следна