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

Резултати

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

Пребарај: #brianglick

当前筛选 #brianglick清除筛选
bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1896 · 20.12.2025 г., 23:49

🔥NEW RELEASE🔥 😁Pressure Drop: Close Range Passing by Brian Glick😁 ➡️Pressure Drop: Close Range Passing is the latest instructional from Brian Glick—one of the most respected teachers in modern jiu-jitsu and a long-time black belt under John Danaher. ➡️Known for his meticulous, methodical, and deceptively simple approach to the art, Brian breaks down the close-range passing game into clear, repeatable steps that any grappler can immediately apply. $197😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Passing#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1894 · 18.12.2025 г., 00:36

🔥NEW RELEASE🔥 😁Dynamic Guard Passing: Inside Position by Brian Glick😁 ➡️Unlock the secrets of high-level standing guard passing with one of the most respected minds in Brazilian Jiu-Jitsu, Brian Glick, black belt under the legendary John Danaher. ➡️This instructional zeroes in on how to pass while standing, using the inside position to dominate exchanges, neutralize leg entanglements, avoid leg locks, and shut down wrestle-up attacks $197😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Passing#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1854 · 07.08.2025 г., 16:51

🔥NEW RELEASE🔥 😁Pressure Drop Dynamic Guard Passing: Outside Position by Brian Glick😁 ➡️Unlock the secrets of high-level guard passing with Pressure Drop Dynamic Guard Passing: Outside Position by Brian Glick, a black belt under the legendary John Danaher. ➡️Renowned for his ability to distill complex techniques into clear, accessible instruction, Brian brings his signature clarity and precision to this must-have series. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#NewWave#NoGi#Passing 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1941 · 22.04.2026 г., 16:14

🐈‍⬛NEW RELEASE 🐈‍⬛ 🐈‍⬛Under Control Transforming Your Closed Guard by Brian Glick 🐈‍⬛ 🐈‍⬛In Under Control: Transforming Your Closed Guard, Brian Glick delivers a complete system for building a closed guard that is tight, efficient, and relentlessly effective—regardless of size or strength 🐈‍⬛This is not a collection of random moves—it’s a carefully structured approach to controlling, breaking, and submitting opponents from one of jiu-jitsu’s most important positions. $197 🐈‍⬛$14.99 🐈‍⬛ ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Transitions#NoGi#NewWave 🐈‍⬛Buy 🐈‍⬛

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1892 · 18.12.2025 г., 00:34

🔥NEW RELEASE🔥 😁Knee Lever Masterclass by Brian Glick😁 ➡️The Knee Lever Masterclass from Brian Glick, a John Danaher black belt and one of BJJ Fanatics’ best-selling instructors, is your complete system for turning one of Jiu-Jitsu’s most underrated techniques into a powerful, all-position weapon ➡️Known for his world-class instruction, clear communication, and simple, effective systems, Brian once again delivers an instructional packed with precise details and universal concepts that make complex ideas easy to apply. $197😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Sweeps#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1844 · 17.07.2025 г., 23:50

🔥NEW RELEASE🔥 😁Crucifix Masterclass by Brian Glick😁 ➡️A direct student of legendary coach John Danaher, Brian breaks down the crucifix in a methodical, accessible system designed to transform this powerful position into a high-percentage part of your game. ➡️Instead, it leverages advanced, submission-based control points that create tremendous vulnerability in your opponent while giving you near-total dominance. ̶$̶1̶9̶7̶😍$14.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#Submission#NoGi#NewWave 💁‍♀️Buy 💁‍♀️

bjjfanaticsinstructionals

@bjjfanaticsinstructionals · Post #1799 · 05.04.2025 г., 23:24

🔥NEW RELEASE🔥 😁Only Way Out: Dynamic Back Escapes By Brian Glick😁 ➡️Unlock your path to freedom with Only Way Out: Dynamic Back Escapes by Brian Glick, one of the most sought-after instructors at BJJ Fanatics. Brian’s teaching ability is renowned for breaking down complex techniques into easily digestible steps, helping practitioners at all levels of Brazilian Jiu-Jitsu (BJJ) master the art of escaping back control. ➡️Whether you're a white belt or a seasoned competitor, Brian's step-by-step breakdowns will give you the tools to confidently escape back control in any situation ➡️This instructional covers a variety of dynamic back escapes, teaching you how to stay calm under pressure and develop the instincts needed to reclaim control. $197😍$19.99😍 ❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️ 📱Payment: 📱📱📱 💰Submeta FOR FREE 🌈UFC Picks 👑MasterClass ✈️@bjjfanaticsinstructionals #BrianGlick#BJJFanatics#NewWave#NoGi#Danaher 💁‍♀️Buy 💁‍♀️