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

Резултати

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

Пребарај: #nftcommunity

当前筛选 #nftcommunity清除筛选

​​🎙Whitelisting announcement of SILKS.IO💥💥💥 The First P2E metaverse powered by the real world of thoroughbred horse racing. 🐎🐎🐎 *Silks* is the first derivative gaming platform that leverages a blockchain-enabled metaverse to parallel the real world of thoroughbred horse racing. The Silks metaverse is powered by a play-to-earn (P2E) gaming economy where anyone can experience the thrill of owning racehorses and horse farms, while earning valuable tokens through skilled gameplay and contributions to the ecosystem. ⭐️ WHITELISTING - GET EARLY ACCESS⭐️ ➖➖➖ ⚙️ About project NFT ⚙️ • Racing skills • Land • Stables • Horses 📌 Members of the Silks ecosystem can participate by: • Speculating on land • Developing land into horse farms • Purchasing and trading horses • Syndicating horses Entering horse ownership pools 📌 Members can earn rewards in the Silks ecosystem by: • Staking horses • Racing horses • Breeding horses Mining (verifying and publishing data to the ecosystem) - Contributing to the Silks ecosystem in various ways ➖➖➖ 🧊 Follow up SILKS.IOmedia🧊 - Website - Twitter - Discord #NFT#NFTCommunity#P2E

UXLINK

@uxlink_community · Post #397 · 07.04.2025 г., 07:12

🎉UXLINK Korea & Japan Club Card Mint Ends Early! 3,000 ETH SOLD OUT! 🎉 🔥Big news for our Korea & Japan community! The Social Club Card NFT mint has CLOSED EARLY due to overwhelming demand (3,000 ETH reached!). THANK YOU for your support! 💥 ⚠️Some updates: ❌Oops! 34.3 ETH oversold due to tech glitch 💵Full refunds of oversold users coming in 2 working days + 100 UXLINK for each elite card & 10 UXLINK for each gold card as apology ⏰TWAP calculation adjusted to Mar 11 - Apr 7 (CMC closing prices) 🚨All other terms remain the same! 🎁Stay tuned for more rewards and community events! Let's keep building this global web3 family together! 🌏💙 Refund list: https://docs.google.com/spreadsheets/d/1A-5Cp--N7_lypHZcMdO6VWCPnPuyOdV7YEuAwGAvRkg/edit?gid=0#gid=0 🎉UXLINK 코리아 & 재팬 클럽 카드 민팅 조기 마감! 3,000 ETH 완판! 🎉 🔥한국과 일본 커뮤니티에 큰 소식을 전해드립니다! Social Club Card NFT 민팅이 엄청난 수요로 인해 조기 마감되었습니다 (3,000 ETH 달성)! 여러분의 뜨거운 성원에 감사드립니다! 💥 ⚠️ 업데이트 안내: ❌ 기술 오류로 인해 34.3 ETH 초과 판매 발생 💵 2영업일 이내 전액 환불 예정 + 사과의 의미로 환불 유저에게 엘리트 카드당 100 UXLINK, 골드 카드당 10 UXLINK 지급 ⏰ TWAP 계산 기간을 3월 11일 ~ 4월 7일(CMC 종가 기준)으로 조정 🚨기타 조건은 모두 동일하게 유지됩니다! 🎁 앞으로 더 많은 보상과 커뮤니티 이벤트가 이어질 예정이니 기대해주세요! 함께 글로벌 Web3 패밀리를 만들어가요! 🌏💙 환불 리스트 : https://docs.google.com/spreadsheets/d/1A-5Cp--N7_lypHZcMdO6VWCPnPuyOdV7YEuAwGAvRkg/edit?gid=0#gid=0 UXLINK Korea & Japan Club Cardのミントが予定より早く終了しました🎉 3,000 ETH分が完売! Korea & Japanコミュニティの皆さま、多くのご参加ありがとうございました! いくつかのご案内です: ・技術的な不具合により、34.3 ETH分がオーバーセールとなりました⚠️ ・対象の方には2営業日以内に全額返金を行います。加えて、お詫びとしてElite Cardごとに100 UXLINK、Gold Cardごとに10 UXLINKを配布いたします🙏 ・TWAP(加重平均価格)の算出期間は、3月11日〜4月7日(CMCの終値ベース)に変更となりました📅 ・その他の条件に変更はありません 今後もさまざまな報酬やコミュニティイベントを予定しています。これからも一緒にグローバルなWeb3コミュニティを盛り上げていきましょう🌐 #UXLINK#NFTCommunity#Web3Journey

SingSing Announcement

@singsingchannel · Post #930 · 25.10.2024 г., 09:13

📢 Exciting news! The NFT Points System is now officially in action 🎉 Starting today, you can earn points with your NFTs! Curious about how it all adds up? Dive into the full calculation details here 👉https://t.me/singsingchannel/911 #NFTPoints#SingSing#NFTCommunity#Web3 🎤Announcement | Chat | X (Twitter) | Website | Game

SingSing Announcement

@singsingchannel · Post #705 · 16.07.2024 г., 13:01

🌟 We're thrilled to announce our partnership with Pirate Frenzy! 🏴‍☠️ Pirate Frenzy, a Play-To-Airdrop Mini App on Telegram by @PirateClashChannel, complements their main game, Pirate Clash Extension, powered by @Ancient8_gg and playable on Twitter. 🦈 With Pirate Frenzy, simply merge fishes and level up $PEARL earnings for $gPBT and $iPBT conversion in preparation for the Pirate Clash airdrop. 🎮 Play Pirate Frenzy for Airdrop Now💫💫 🤝 Together, we're embarking on a new journey. Stay tuned for exciting collaborations and innovative projects! 🚀✨ Read more and open Treasure at: X Post #SingSing#PirateFrenzy#NFTCommunity#Web3

TokenPocket

@tokenpocket_channel · Post #994 · 11.12.2023 г., 04:16

🆕Ordinals NFT is available on TokenPocket_TP! 👉https://www.tokenpocket.pro/ 🚀From now on, you can easily discover your cute #Bitcoin#OrdinalsNFT on the TokenPocket_TP NFT section, including Recursive Inscriptions! ❓What's your favorite #Ordinals NFT? BitcoinFrogs BitcoinDogeClub fomojis #NFA#TokenPocket#NFTCommunity 【Details】https://twitter.com/TokenPocket_TP/status/1734063966945751497 【Powered By】Crypto Box

SingSing Announcement

@singsingchannel · Post #728 · 21.07.2024 г., 11:38

🔥 The NFT trading competition is hotter than ever! 🔥 Reminder: Only transactions made through OpenSea will be counted. 🛳️ Tips: You should use OKX wallet mobile app to make it easy🚀 Follow the guideline and join the excitement! 📈✨ #NFT#TradingCompetition#OpenSea#NFTCommunity

SingSing Announcement

@singsingchannel · Post #709 · 17.07.2024 г., 02:15

Treasure NFT Session 6 is officially SOLD OUT! 🎉 Thank you for your amazing support. We're thrilled to announce that the whitelist for Session 7 is now OPEN! To be eligible: 1️⃣Comment on this Post, tag 3 friends. 2️⃣Fill out the form with your wallet address and the comment link👉form (this form will be closed at 14:00 UTC - July 22) Don’t miss your chance to be part of the next adventure. 🚀 Note: The additional Whitelist Pool will be opened in next few hours! #TreasureNFT#SoldOut#Session6#Whitelist#NFTCommunity

SingSing Announcement

@singsingchannel · Post #694 · 11.07.2024 г., 10:54

Treasure NFT Session 5 is officially SOLD OUT! 🎉 Thank you for your amazing support. We're thrilled to announce that the whitelist for Session 6 is now OPEN! To be eligible: 1️⃣Comment on this Post, tag 3 friends. 2️⃣Fill out the form with your wallet address and the comment link👉https://forms.gle/qutLw7av9qbzCNVm8 (this form will be closed at 14:00 UTC - July 15) Don’t miss your chance to be part of the next adventure. 🚀 #TreasureNFT#SoldOut#Session5#Whitelist#NFTCommunity