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

Резултати

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

Пребарај: #web3gaming

当前筛选 #web3gaming清除筛选
TONlines – News

@tonlines · Post #6748 · 14.04.2025 г., 09:44

⚡️TapSwap Community: Upcoming Exciting Developments #TapSwap#Web3Gaming The TapSwap Community announces upcoming major platform updates, new gameplay reveals, and a fresh phase for $TAPS. These developments are expected in the coming weeks. Source: link @tonlines

CyberCharge Announcements

@cyberchargeannouncements · Post #32 · 30.08.2024 г., 16:59

🔋Amazing to see our founder connecting with industry legends and innovators at the Real Games, Real Rewards event! ⭐️Excited about the insights and collaborations that will power the future of gaming and Web3. 🤝Big thanks to @gate_ventures, @Metadomo, and @Moxyio for making this event possible! #CyberCharge#Web3Gaming Like👍, Retweet🔵, Comment Link to the Tweet! 🔗Tweet From Our Co-Founder: Read

TONlines – News

@tonlines · Post #7040 · 04.05.2025 г., 13:46

Open Metaverse Podcast Features Catizen Co-Founder #gaming#web3gaming Catizen Announcement introduces a new episode of the Open Metaverse Podcast featuring Ricky Wong, co-founder and CFO of Catizen. The discussion covers his transition from auditor to Web3 entrepreneur and insights into building a gaming ecosystem. Source: link @tonlines

TONlines – News

@tonlines · Post #6980 · 30.04.2025 г., 11:37

⚡️Catizen Announcement: Strategic Partnership with Animoca Brands #TON#Web3Gaming#Catizen Catizen Announcement reveals a strategic partnership with Animoca Brands, enhancing their position as a leading Telegram Mini App game on TON. With a user base of over 40 million and 30 million CATI tokens utilized, Catizen is dedicated to developing a robust Web3 ecosystem around gaming, tokens, and Mini Apps. Source: link @tonlines

Free Airdrop News 🔥🔥🔥

@free_airdrop_nn · Post #216 · 11.01.2024 г., 21:10

🎮 Exciting News! Dive into the world of NotCoin, the biggest Web3 game! 🌐🚀 Unleash your gaming prowess, explore virtual realms, and earn real rewards. 💰🕹 Join the revolution now! 👉 Explore the limitless possibilities: https://t.me/notcoin_bot?start=r_577856_2232895🎮🌟#NotCoin#Web3Gaming

Airdrop Market Pro

@airdrop_market_pro · Post #392 · 11.01.2024 г., 21:10

🎮 Exciting News! Dive into the world of NotCoin, the biggest Web3 game! 🌐🚀 Unleash your gaming prowess, explore virtual realms, and earn real rewards. 💰🕹 Join the revolution now! 👉 Explore the limitless possibilities: https://t.me/notcoin_bot?start=r_577856_2232895🎮🌟#NotCoin#Web3Gaming

NFT & Airdrop News

@airdrop_nft1 · Post #387 · 11.01.2024 г., 21:10

🎮 Exciting News! Dive into the world of NotCoin, the biggest Web3 game! 🌐🚀 Unleash your gaming prowess, explore virtual realms, and earn real rewards. 💰🕹 Join the revolution now! 👉 Explore the limitless possibilities: https://t.me/notcoin_bot?start=r_577856_2232895🎮🌟#NotCoin#Web3Gaming

TONlines – News

@tonlines · Post #7105 · 08.05.2025 г., 12:14

TapSwap Community: Share Your Ideas for the Beta #TapSwapBeta#Web3Gaming TapSwap is inviting community members to contribute ideas for their beta version. Participants can suggest game ideas, features to test, or provide feedback on existing elements. Successful ideas may be implemented in the final release. Source: link @tonlines

UXLINK

@uxlink_community · Post #319 · 07.03.2025 г., 06:02

🤝UXLINK x @TOKYOBEAST_JP: 日本コミュニティパートナーシップ発表! 🇯🇵 UXLINKは、TOKYOBEASTと日本コミュニティパートナーシップを締結しました! 🎉 TOKYOBEASTは、ゲーム・クリプト・予想を融合させた革新的なWeb3エンターテインメントプロジェクトです。 💰 2,000万ドルの開発予算 & 業界のプロ80名が手掛けるこのプロジェクトは、数百万のWeb2ユーザーをWeb3へとスムーズに導きます。 このパートナーシップを通じて、UXLINKは日本のWeb3コミュニティの成長と発展を支援し、より多くのユーザーにこの革新的な体験を届けます! 一緒にWeb3の未来を創りましょう! 🤝UXLINK x @TOKYOBEAST_EN: Japan Community Partnership Announcement! 🇯🇵 We’re excited to announce our Japan Community Partnership with TOKYOBEAST, a cutting-edge Web3 entertainment ecosystem that fuses gaming, crypto, and prediction like never before! With a $20M development budget and a team of 80 industry experts, TOKYOBEAST is set to attract millions of Web2 users and seamlessly transition them into Web3. Through this partnership, UXLINK will help grow and engage the Japanese Web3 community, connecting users to this revolutionary gaming experience. Stay tuned for more updates as we expand the Web3 community together! #UXLINK#TOKYOBEAST#Web3Gaming

SingSing Announcement

@singsingchannel · Post #1019 · 17.11.2024 г., 15:03

🚀 Big Announcement - Snapshot Completed! 🎉 The snapshot for the Tycoon Airdrop was successfully completed at 14:00 UTC, Nov 17! The qualified participants list is ready, based on the previously announced criteria. 📖 Review the details: 1️⃣ Tycoon Point calculation & mandatory conditions: https://t.me/singsingchannel/965 2️⃣ Eligibility criteria & conversion rate: https://t.me/singsingchannel/996 ✨On Nov 18, we will reveal the qualified list along with the corresponding $SING amount you’ve earned⏰Specific claim time will be announced tomorrow (Nov 18). Stay tuned! #SingSingAirdrop#Web3Gaming

SingSing Announcement

@singsingchannel · Post #1112 · 16.12.2024 г., 10:44

🚨 Big news! 🎮$SING is now integrated into our partner game - Chickizen! From now on, you can enjoy Chickizen with even more options and flexibility. 🐥✨ 💳 Payment just got easier, smoother, and more rewarding! Dive in, play, and explore Chickizen like never before! Easily buy $SING at: - BingX: https://bingx.com/en/spot/SINGUSDT/ - CoinEx: https://www.coinex.com/en/exchange/sing-usdt - SingSing Mini App: https://t.me/SingSing_TG_bot/app?startapp=_wallet - OKX Wallet: Guideline (https://t.me/singsingchannel/1088) Play Chickizen with $SING: https://t.me/chickizenbot/app #SingSing#Chickizen#Web3Gaming

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