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

Резултати

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

Пребарај: #malawi

当前筛选 #malawi清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40713 · 28.02.2026 г., 07:01

Hastings Banda was Malawi’s first president, ruling from 1966 to 1994. His government was known for using violence, imprisonment, and suppression of opponents. Many people were jailed or killed for speaking against him. His rule was marked by harsh punishments and human rights abuses. 🇲🇼🚨 [Read more] @googlefactss #Malawi#HastingsBanda#HumanRights#History#Leadership#dictator

Crypto M - Crypto News

@CryptoM · Post #64693 · 09.04.2026 г., 14:29

🚀 Stablecoin FX Pricing Tightens in Emerging Markets by March According to NS3.AI, Borderless reported that 14 out of 21 monitored blockchain-based currencies were within 100 basis points of interbank rates by March, indicating tighter stablecoin foreign exchange pricing in emerging markets. In Latin America, stablecoin FX traded approximately 22 basis points from interbank rates throughout the quarter, while execution costs in Brazil reached zero basis points across various providers. In East Africa, pricing gaps narrowed significantly, although Zambia and Malawi continued to experience wide fluctuations in less liquid markets. #stablecoin#FXpricing#emergingmarkets#blockchain#LatinAmerica#EastAfrica#Brazil#Zambia#Malawi#interbankrates

AI match predictions

@ai_match_prediction · Post #11204 · 28.03.2026 г., 05:05

Friendlies🏳 2026-03-28 09:30 UTC Hungary U17 vs. Moldova U17 Predicted outcome: Hungary U17✅ Predicted score: 2:1 Actual: Hungary U17 3:1 #HungaryU17#MoldovaU17 2026-03-28 10:00 UTC Wales U19 vs. USA U19 Predicted outcome: USA U19✅ Predicted score: 0:1 Actual: USA U19 0:4 #WalesU19#USAU19 2026-03-28 11:35 UTC China PR U23 vs. Korea DPR U23 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #ChinaPRU23#KoreaDPRU23 2026-03-28 13:00 UTC Zambia U23 vs. Malawi Predicted outcome: Zambia U23✅ Predicted score: 2:1 Actual: Zambia U23 1:0 #ZambiaU23#Malawi 2026-03-28 13:30 UTC India U23 vs. Bhutan U23 Predicted outcome: India U23✅ Predicted score: 3:1 Actual: India U23 5:0 #IndiaU23#BhutanU23 2026-03-28 14:00 UTC South Korea vs. Ivory Coast Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Ivory Coast 0:4 #SouthKorea#IvoryCoast 2026-03-28 14:00 UTC San Marino vs. Faroe Islands Predicted outcome: Faroe Islands✅ Predicted score: 0:2 Actual: Faroe Islands 1:2 #SanMarino#FaroeIslands 2026-03-28 14:00 UTC Kyrgyzstan vs. Madagascar Predicted outcome: Madagascar✅ Predicted score: 1:2 Actual: Madagascar 2:5 #Kyrgyzstan#Madagascar 2026-03-28 14:00 UTC Portugal U18 vs. Iceland U19 Predicted outcome: Portugal U18✅ Predicted score: 2:1 Actual: Portugal U18 4:0 #PortugalU18#IcelandU19 2026-03-28 16:00 UTC Senegal vs. Peru Predicted outcome: Senegal✅ Predicted score: 2:1 Actual: Senegal 2:0 #Senegal#Peru 2026-03-28 16:00 UTC Botswana vs. Zimbabwe Predicted outcome: Zimbabwe✅ Predicted score: 0:1 Actual: Zimbabwe 0:3 #Botswana#Zimbabwe 2026-03-28 16:00 UTC Egypt U20 vs. Algeria U20 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 2:2 #EgyptU20#AlgeriaU20 2026-03-28 17:00 UTC Hungary vs. Slovenia Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Hungary 1:0 #Hungary#Slovenia 2026-03-28 17:00 UTC Scotland vs. Japan Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Japan 0:1 #Scotland#Japan 2026-03-28 18:00 UTC Burkina Faso vs. Guinea-Bissau Predicted outcome: Burkina Faso✅ Predicted score: 2:1 Actual: Burkina Faso 5:0 #BurkinaFaso#GuineaBissau 2026-03-28 18:00 UTC USA U18 vs. Morocco U18 Predicted outcome: USA U18❌ Predicted score: 2:1 Actual: Morocco U18 1:2 #USAU18#MoroccoU18 2026-03-28 19:30 UTC USA vs. Belgium Predicted outcome: USA❌ Predicted score: 2:1 Actual: Belgium 2:5 #USA#Belgium 2026-03-28 22:00 UTC Brazil U20 vs. Paraguay U20 Predicted outcome: Brazil U20✅ Predicted score: 3:1 Actual: Brazil U20 3:1 #BrazilU20#ParaguayU20 2026-03-29 00:00 UTC Haiti vs. Tunisia Predicted outcome: Tunisia✅ Predicted score: 1:2 Actual: Tunisia 0:1 #Haiti#Tunisia 2026-03-29 01:00 UTC Mexico vs. Portugal Predicted outcome: Portugal❌ Predicted score: 1:2 Actual: Draw 0:0 #Mexico#Portugal #Football#Friendlies

AI match predictions

@ai_match_prediction · Post #11223 · 31.03.2026 г., 01:05

Friendlies🏳 2026-03-31 07:00 UTC Korea DPR U23 vs. Thailand U23 Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Korea DPR U23 3:1 #KoreaDPRU23#ThailandU23 2026-03-31 09:00 UTC Equatorial Guinea vs. Madagascar Predicted outcome: Madagascar❌ Predicted score: 1:2 Actual: Draw 1:1 #EquatorialGuinea#Madagascar 2026-03-31 11:35 UTC China PR U23 vs. Vietnam U23 Predicted outcome: Draw❌ Predicted score: 1:1 Actual: China PR U23 1:0 #ChinaPRU23#VietnamU23 2026-03-31 11:35 UTC China PR U20 vs. Australia U20 Predicted outcome: Australia U20✅ Predicted score: 1:2 Actual: Australia U20 2:4 #ChinaPRU20#AustraliaU20 2026-03-31 12:00 UTC Morocco U18 vs. Iceland U19 Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Morocco U18 2:1 #MoroccoU18#IcelandU19 2026-03-31 13:00 UTC Costa Rica vs. Iran Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Iran 0:5 #CostaRica#Iran 2026-03-31 13:00 UTC Portugal U18 vs. USA U18 Predicted outcome: Portugal U18❌ Predicted score: 2:1 Actual: Draw 1:1 #PortugalU18#USAU18 2026-03-31 13:00 UTC Botswana vs. Malawi Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Botswana 1:0 #Botswana#Malawi 2026-03-31 13:00 UTC Egypt U20 vs. Algeria U20 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #EgyptU20#AlgeriaU20 2026-03-31 13:30 UTC India U23 vs. Tajikistan U23 Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Tajikistan U23 0:1 #IndiaU23#TajikistanU23 2026-03-31 13:45 UTC UAE U23 vs. Oman U23 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #UAEU23#OmanU23 2026-03-31 14:30 UTC Chile U20 vs. Peru U20 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #ChileU20#PeruU20 2026-03-31 15:00 UTC Liberia vs. Libya Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 2:2 #Liberia#Libya 2026-03-31 15:00 UTC Niger vs. Togo Predicted outcome: Niger❌ Predicted score: 2:1 Actual: Togo 0:1 #Niger#Togo 2026-03-31 16:00 UTC Serbia vs. Saudi Arabia Predicted outcome: Saudi Arabia❌ Predicted score: 0:1 Actual: Serbia 2:1 #Serbia#SaudiArabia 2026-03-31 16:00 UTC Norway vs. Switzerland Predicted outcome: Switzerland❌ Predicted score: 0:1 Actual: Draw 0:0 #Norway#Switzerland 2026-03-31 16:00 UTC Montenegro vs. Slovenia Predicted outcome: Slovenia✅ Predicted score: 1:2 Actual: Slovenia 2:3 #Montenegro#Slovenia 🔥 PREMIUM PICK 🔥 2026-03-31 16:00 UTC San Marino vs. Andorra Predicted outcome: Andorra❌ Predicted score: 0:1 Actual: Draw 0:0 #SanMarino#Andorra 2026-03-31 16:00 UTC Zimbabwe vs. Zambia U23 Predicted outcome: Zimbabwe✅ Predicted score: 2:1 Actual: Zimbabwe 1:0 #Zimbabwe#ZambiaU23 2026-03-31 17:00 UTC Russia vs. Mali Predicted outcome: Russia❌ Predicted score: 1:0 Actual: Draw 0:0 #Russia#Mali 2026-03-31 17:00 UTC Hungary vs. Greece Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #Hungary#Greece 2026-03-31 17:30 UTC Haiti vs. Iceland Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Haiti#Iceland #Football#Friendlies