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 слични објави

Пребарај: #johndanaher

当前筛选 #johndanaher清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1944 · 22.04.2026 г., 16:18

🐈‍⬛NEW RELEASE 🐈‍⬛ 🐈‍⬛Master the Move: Toreando Guard Pass by John Danaher 🐈‍⬛ 🐈‍⬛Master one of the most dominant and reliable guard passing systems in Brazilian Jiu-Jitsu with Master the Move: Toreando Guard Pass by John Danaher. 🐈‍⬛In this comprehensive instructional, he turns his attention to the toreando (bullfighter) pass—arguably the highest percentage and most versatile guard pass in the sport. $197 🐈‍⬛$19.99 🐈‍⬛ ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#Passing#NoGi#NewWave 🐈‍⬛Buy 🐈‍⬛

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1909 · 29.01.2026 г., 16:20

🔥NEW RELEASE🔥 😁Master The Move: The Knee Cut Guard Pass By John Danaher😁 ➡️The knee cut pass is one of the most dominant and highest-percentage guard passes in Brazilian Jiu-Jitsu—and no one understands it more deeply than John Danaher. ➡️From controlling the far-side shoulder and dominating the near-side hip, to precise knee placement, underhook mechanics, and passing posture, nothing is left unexplained $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#Passing#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1857 · 13.08.2025 г., 18:35

🔥NEW RELEASE🔥 😁Master The Move: The Shoulder Crunch Series By John Danaher😁 ➡️Learn The Shoulder Crunch System That John Danaher’s Elite Students Use To Break Through Modern No-Gi Guards & Control Opponents Like Never Before ➡️This position has become a staple in the arsenal of Danaher’s most successful students, including Gordon Ryan and Giancarlo Bodoni, for its ability to shut down modern pressure passing, neutralize resistance, and launch devastating attacks. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#NewWave#NoGi#Guard 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1873 · 05.11.2025 г., 03:52

🔥NEW RELEASE🔥 😁Master The Move: The Butterfly Guard Sweep Sumi Gaeshi by John Danaher😁 ➡️In Master The Move: The Butterfly Guard Sweep Sumi Gaeshi, Danaher breaks down what many consider the single most effective sweep in grappling. ➡️Now, for the first time, Danaher reveals the complete system behind the Sumi Gaeshi sweep from butterfly guard — the same position that connects effortlessly to leg locks, back takes, and devastating top control sequences. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#Sweeps#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1820 · 30.05.2025 г., 20:32

🔥NEW RELEASE🔥 😁Master The Move: The Back Crucifix By John Danaher😁 ➡️Unlock one of the most dominant and devastating positions in Brazilian Jiu-Jitsu with Master The Move: The Back Crucifix, a groundbreaking instructional series by legendary coach John Danaher ➡️The back crucifix is unique — it doesn’t earn points in competition, yet it offers extraordinary submission opportunities through unparalleled control and leverage. ➡️In this meticulously crafted series, Danaher breaks down every nuance of the back crucifix, revealing how to achieve, maintain, and capitalize on this position with precision. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#Crucifix#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1801 · 10.04.2025 г., 19:26

🔥NEW RELEASE🔥 😁Master The Move: The Side Crucifix By John Danaher😁 ➡️Unlock the power of the Side Crucifix with John Danaher in this must-have instructional video from his best-selling "Master The Move" series ➡️With clear, step-by-step instructions, John reveals the fundamental principles behind the Side Crucifix, a position that allows you to dominate your opponent with high-percentage attacks, all without requiring advanced athletic ability. ➡️If you want to improve your upper body submission game and finish your opponents with efficiency and precision, the Side Crucifix is your new go-to position $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #JohnDanaher#BJJFanatics#NewWave#NoGi#Danaher 💁‍♀️Buy 💁‍♀️