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

Резултати

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

Пребарај: #memecontest

当前筛选 #memecontest清除筛选
DeckForge Announcement

@deckforge_official · Post #304 · 07.07.2025 г., 10:37

Meme Contest Winners: USDT Rewards Collection 💸 We’ve heard you loud and clear — many of you asked for USDT rewards, and we’re making it happen. All 250 winners from the Meme Contest will receive their rewards in USDT equivalent! Please fill out the form below to receive your prize. 🔗Google Form Link 🚨 Important: 🔵 Double-check all your info before submitting – you can only submit once 🔵 Only use a valid EVM wallet address (e.g. MetaMask, Trust Wallet) 🔵 Rewards will be sent in USDT (BEP20 / BNB Chain) 🚫 Do NOT submit TON or TRC20 addresses — they will not be accepted We’re preparing the distribution — and… More updates are coming later today about the upcoming Closed Beta launch. Stay tuned, Forgers 👀 #DeckForge#ClosedBeta#MemeContest Join the DeckForge Community: 🌐YouTube𝕏Twitter🎮Discord 👉Chat👉Announcements👉DeckForge

DeckForge Announcement

@deckforge_official · Post #303 · 04.07.2025 г., 18:45

Meme Contest – Final Results The community has spoken — and it's time to crown the champions. After two weeks of chaos, creativity, and incredible humor, we’re excited to reveal the final leaderboard of our Meme Contest. 🔗Leaderboard – TOP-250 Memers Prizes will be distributed this weekend Huge thanks to every Forger who participated — your memes, energy, and wit made this one of the most fun events we've ever hosted. But that’s not all... Alpha Reveal Incoming On July 10, our team will showcase the first Alpha build of DeckForge at one of the leading game dev conferences in Eastern Europe. Over 20,000+ players are already waiting for the Closed Beta – and we’re almost there. 🔥 The Forge is heating up. Next week, we’ll be dropping major updates, sneak peeks, and what's next for the community. Stay sharp, Stay Forged. #DeckForge#ClosedBeta#MemeContest Join the DeckForge Community: 🌐YouTube𝕏Twitter🎮Discord 👉Chat👉Announcements👉DeckForge

Airdrop Strikers™

@airdropstrikers · Post #1755 · 07.04.2024 г., 10:44

👑New Meme Contest 👑 💰Reward : 100 USDT For Top 10 People🤑 👑Contest Link : Meme Contest ⭐Steps to take Part ⭐ Follow @dict00 ⭐ Like RT Quite this tweet+comments @ 3 friends ⭐ Add your #DICT meme to the comments below ⭐ Must join Telegram Channel ⭐ Send proof in Telegram group with retweet link #MemeContest#100USDT#USDT#giveaway 🔔Note: Please do your own research (DYOR) before joining to any project.Don't send any fee or penny without doing own research ✈️Business:@ProjectPromoters✅

Airdrop Ninja™

@airdropsalertteam · Post #8124 · 13.05.2023 г., 13:49

#MEMECONTEST#PHILMEMECONTEST MEME & STICKER COMPETITION ALERT!👀👀👀 🎉🎉Our BIGGEST PRIZE POOL YET 💯💯 🙌🏼500 WINNERS 💰500,000 $PHL Token prize pot | 1000 $PHL per winner💰 🤩Have your designs used by a GLOBAL COMMUNITY All you need to do is: ✅Design a meme or sticker for our #PHILApp and #Philcoin social media channels ✅Tag us on social media for a chance to win using #PHILNation T&Cs apply Competition ends Friday 11th, Feb. 2022 TELEGRAM GROUP | TELEGRAM CHANNEL | TWITTER | FACEBOOK | LINKEDIN | INSTAGRAM

TMONK Announcements

@tmonkannouncements · Post #113 · 21.04.2024 г., 15:02

💎$TMONK #RoadToMEMELANDIA# Contest💎 1️⃣st 100 token $TMONK 2️⃣st 70 token $TMONK 3️⃣st 30 token $TMONK 👀5 more participants will get WL spot in upcoming private sale of our partner ATHENA DexFI How to enter the #contest : 1️⃣Follow @ https://x.com/TMonkPartners?s=35 2️⃣ Join telegram groups: ✔️https://t.me/RoadToMEMELANDIA ✔️ https://t.me/TmonkAnnouncements 3️⃣ Under the tweet of this contest present on X https://x.com/TMonkPartners?s=35 Answer with a post with original and funny TMONK memes ( Video, gif or stickers are welcome as well ) You can create as many as you want . Share your post to atleast 3 real yours friends(we will check if you don’t respect this rule or share to someone that isn t your friend) Remember to put also @ton_blockchain and @telegram and to use hashtags #MemeContest#freedom#crowdfunding#charity#tmonk 4️⃣. Submit your X entry under the comments of relatived post of this two groups 🖥https://t.me/RoadToMEMELANDIA 🖥 https://t.me/TmonkAnnouncements The 8️⃣ winners will be chosen by the team Valid for 4️⃣ days Ends 25.04.2024 15 utc UTC GOOD LUCK TMONKERS