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

Резултати

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

Пребарај: #stablecoinwallet

当前筛选 #stablecoinwallet清除筛选
TokenPocket

@tokenpocket_channel · Post #1734 · 24.12.2025 г., 09:28

🔥「0」Gas $U Transfers on BNBCHAIN with TokenPocket! TokenPocket now enables transferring $U with 0 gas fee on the BNB Chain automatically - enjoy smooth, 0-gas transfers, all with a secure, wallet-native experience. Your first choice of #StablecoinWallet 👉http://tp.xyz https://x.com/TokenPocket_TP/status/2003755846489231701?s=20

TokenPocket

@tokenpocket_channel · Post #1732 · 22.12.2025 г., 10:12

🆕$U is now listed on TokenPocket! Manage your $U seamlessly with TokenPocket_TP: store, send, and swap in one powerful multi-chain #StablecoinWallet. Track Easier! Trade Smarter! 👉http://tp.xyz

TokenPocket

@tokenpocket_channel · Post #1731 · 22.12.2025 г., 08:54

🟦 TokenPocket Weekly Report 🟦 🔵 Supported $U on TokenPocket. 🔵 Embrace New Era of #StablecoinWallet 🔵 Notice of Wallet Service Upgrade 🔵 Listed 5 DApps. All-in-one, all in TokenPocket 👉http://tp.xyz

TokenPocket

@tokenpocket_channel · Post #1723 · 03.12.2025 г., 09:18

🚀TokenPocket Now Supports Multi-Chain Gas Payment with Stablecoins! Powered by EIP-7702, TokenPocket now enables transferring gas payments in $USDT, $USDC, and more across multi-chains — including BNBCHAIN, base, and arbitrum — for a smoother, more cost-efficient transfer experience. 🔥 Explore it now in #StablecoinWallet! 🔗Tutorial

TokenPocket

@tokenpocket_channel · Post #1653 · 30.07.2025 г., 08:25

🧊Be Your First #StablecoinWallet! → https://help.tokenpocket.pro/en/wallet-operation/stablecoin/wallet ✅ Self-custody, your keys, your coins! ✅ Multichain supported — one wallet, all chains! ✅ Gas-free stablecoin transfers on BNBChain & Tron (more coming!) 🔐 Powered by TokenPocket — simple, secure, seamless.

TokenPocket

@tokenpocket_channel · Post #1639 · 02.07.2025 г., 02:52

📝 TokenPocket Monthly Report — June 2025 📖 Read the full report: https://tokenpocket-gm.medium.com/tokenpocket-monthly-report-june-2025-8a642e365b94 Main Upgrade ⏬ 🎯#StablecoinWallet 🎯 Market Chart Upgraded 🎯 Gas-Free Transfer on TRON and BNBChain 🎯 Security Enhancement: Now supporting native MultiSig wallets for Bitcoin and Core — giving your assets even stronger protection. ✍️Share your thoughts and suggestions through our survey for a chance to win exclusive prizes. Every piece of feedback is valued! ✍️ Fill out the Q&A⏬ https://docs.google.com/forms/d/e/1FAIpQLSe8tElYK6V6qN5MqDtDIj7G7SjUw3cSv3bwC-rSXyLVq2USRQ/viewform?usp=send_form 📍 All In One, All In TokenPocket! 🔗https://tp.xyz

TokenPocket

@tokenpocket_channel · Post #1633 · 23.06.2025 г., 04:16

🔥USDT Supply on the TRON Surpasses $80 Billion, now accounting for over 51.74% of global circulation, making TRON the leading stablecoin network. TokenPocket plays a key role by helping users save on gas through innovations like USDT gas payments, one-click energy rentals, and daily subsidy programs. In 2025, TokenPocket continues to scale stablecoin usability — reinforcing its position as the go-to #StablecoinWallet for global users! https://x.com/TokenPocket_TP/status/1936994956620750933

TokenPocket

@tokenpocket_channel · Post #1727 · 10.12.2025 г., 09:10

🎁 Pay Gas with Stablecoins & Share a Price Pool of $2,000 →https://zealy.io/cw/tokenpocket/questboard/sprints 🚀 New round of #StablecoinWallet Campaign is now live on zealy — complete quests and experience paying gas fees with stablecoins via TokenPocket. *Exclusively for the community. No investment advice! Any new quests will be announced in our Telegram community first.💕💕#NFA

TokenPocket

@tokenpocket_channel · Post #1761 · 13.02.2026 г., 03:45

📝 TokenPocket Monthly Report — January 2026 In January, TokenPocket focused on stablecoins, security enhancement and trading experience. 🎯#SAFU TokenPocket now supports Solana Multi-Sig Wallet with native integration. Multi-Sig, Multi- Safe. 🎯 Advanced Trading Experience TokenPocket has expanded Limit Order support to Ethereum, Base, BNB Chain, Arbitrum, and Polygon. With limit orders, users can define their target prices in advance and execute with more discipline. Better execution quality with less time spent watching charts. 🎯#StablecoinWallet TokenPocket now supports stablecoin gas payment on Base, BNB Chain, Polygon, Arbitrum, and Ethereum, and this capability is also available in Swap & Bridge. That means users can pay network fees with stablecoins in more scenarios, reducing reliance on native gas tokens and making transfers, swaps, and bridging much smoother. 📍 All In One, All in TokenPocket https://tokenpocket-gm.medium.com/tokenpocket-monthly-report-january-2026-2c48e070338e

TokenPocket

@tokenpocket_channel · Post #1705 · 04.11.2025 г., 03:31

🚀 Keep Enjoying BNBCHAIN Gas-Free Stablecoin Transfers with TokenPocket! ✅ Supports $USDC & #USD1 - Ends on Nov 30, 2025. ( $USDT Support Ended on Oct 31, 2025) 🔷 Perfect for daily transfers with user-friendly interface. Unlock the future of #StablecoinWallet with TokenPocket. 👉http://tp.xyz

TokenPocket

@tokenpocket_channel · Post #1640 · 02.07.2025 г., 04:29

🎉 Enjoy Gas-Free Stablecoin Transfers on BNBCHAIN with TokenPocket. ✅Supports $USDT & #USD1 - Ended on July 31 🔷Perfect for new users & everyday transfers. Transfer smarter with your #StablecoinWallet! 👉https://tp.xyz

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