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

Резултати

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

Пребарај: #expression

当前筛选 #expression清除筛选
English With Natives*

@sirjimmy · Post #31808 · 03.12.2025 г., 17:02

⭐Expression: “Easy peasy Japanesey!” When something is so simple you can do it with your eyes half-closed,Americans sometimes joke and say: 👉 “Easy peasy Japanesey!” It’s playful, childish, and super informal, perfect when you want to sound fun and light-hearted. Example: A: Can you fix this for me? B: Sure. Easy peasy Japanesey! Meaning: “Piece of cake. No big deal.” #Expression #Teamjimmy @Sirjimmy

English With Natives*

@sirjimmy · Post #31802 · 30.11.2025 г., 05:46

🌍Around the world in expressions!✈️ 🇨🇭“I’m Switzerland” – Staying neutral like a pro. 🇫🇷“Excuse my French” – Oops… did I just swear? 😅 🇬🇷“It’s all Greek to me” – Totally incomprehensible! 🤯 🇳🇱 “Let’s go Dutch” – Sharing is caring (and paying!) 💸 💬 Which one is your favorite? Or do you have your own “worldly” saying? #Expression #Teamjimmy @Sirjimmy

English With Natives*

@sirjimmy · Post #31791 · 26.11.2025 г., 16:53

🔵 Today’s Expression: “Whatchamacallit” /ˈwɒtʃəməˌkɔːlɪt/ “Whatchamacallit” is a fun, casual word we use when we can’t remember the name of something or when the name simply doesn’t matter. 🔹Meaning A playful replacement for the name of an object you can’t recall. 🔹Examples 🔹Pass me that whatchamacallit...the phone holder. 🔹Do we still have that spicy whatchamacallit sauce? 🔹I need the whatchamacallit to connect my laptop to the TV. #Expression #Teamjimmy @Sirjimmy

1 English learning materials

@englishmeta1 · Post #19 · 05.02.2022 г., 15:05

❤️ It's my turn to + (verb) ✍🏻« When stating 'my turn' you are telling someone that it is time to change position or position focuses on to you.» 💭Here are some examples: 🔷"It's my turn to walk you home.” 🔷"It's my turn to do laundry." 🔷"It's my turn to take out the trash." 🔷"It is my turn to roll the dice." 🔷"It is my turn to attempt solving the problem." #Expression #Teamjimmy #sirjimmy

1 English learning materials

@englishmeta1 · Post #18 · 05.02.2022 г., 04:32

The point is that + (subject + verb) ✍🏻«By stating 'the point is' you are stating in your opinion the meaning about what is actually happening.» 📍Here are some examples:📍 📕"The point is that if you study you will do well in school." 📕"The point is that she does not understand." 📕"The point is that the world would be a better place." 📕"The point is that snakes can be dangerous." 📕"The point is that leaving a baby alone is not a good idea." 📕"The point is that if we do not leave now we will be late." 📕"The point is that she needs to be more responsible." ◽️◽️◽️◽️◽️◽️◽️◽️◽️ #Expression #Teamjimmy #sirjimmy

Toward Discovering English

@TowardDiscoveringEnglish · Post #844 · 29.05.2022 г., 13:52

💢 Ahead Of One's Time 🎨 Meaning: 🍃 In advance of current ideas and trends. 🎨 Usage: 🍃 Some people describe Albert Einstein was a physicist ahead of his time. 〰〰〰〰〰〰〰〰〰〰〰〰 Level: Intermediate_Advanced ========================= #Idiom#Expression#Ahead @TowardDiscoveringEnglish

MDC Uzbekistan

@mdcuzbekistan · Post #641 · 20.01.2023 г., 13:51

Expressionlar va ulardan resurslar so'rovlarida foydalanish Talablarga binoan, siz kutgan mavzu - Expressionlar. Barchaga ma'lumki, database dan kelayotgan ma'lumotlarni dinamik holatda filterlash, saralash unchalik ham oson emas. Ushbu mahorat darsimizda, Sultonbek sizlarga expression/query lar bilan ishlashning yangicha usulini taqdim etmoqchi. Eng qizig'i shundaki, bizning speaker mavzudan ilhomlanib, ushbu amaliyot uchun yangi kutubxona ham ishlab chiqishga ulguribdi. Judayam qiziq, sinab ko'ramiz-a, nima deysiz? Barchangizni ushbu mahorat darsida kutib qolamiz. Kirsangiz xursand bo'lamiz, kirmasangiz hafa bo'lish yo'q ) Sana: 22-yanvar, 20:00 Havola: Zoom Speaker: Sultonbek Rakhimov #expression#linq#filtering#sorting .NET Uzbekistan Community ➖➖➖➖➖➖➖➖➖➖ Telegram | Instagram | Youtube

BBC Learning English

@english_bbc_learning · Post #3804 · 14.12.2025 г., 07:15

Do you know someone who always thinks that everyone else has a better life than them?! 🙄😅 Scroll through the images to find out how to use ‘the grass is always greener on the other side’ 🌱, and don’t forget to answer the questions on the last slide! ⁣ ⁣ EXTRA: Could walking 7,000 steps a day could improve your mental health? 🚶 Click the link in our bio to find out and learn some useful vocabulary in the process! 📰💚⁣ ⁣ Image: Getty⁣ ⁣ #vocabulary#learnenglish#englishlanguage#expression#idiom#proverb#englishclass#speakenglish

ART IN SPORT

@BarykinaLiubov · Post #2017 · 10.08.2025 г., 21:01

Master Class in Koblenz, Germany 🇩🇪 2025 @rsg.koblenz Мастер-класс международного Проекта „Art in Sport” В Кобленце, Германия #Dancing#Expression #Artistic#Emotionality #LiubovBarykina#Choreographer #PersonalCoach#ArtlnSport For individual training sessions And master classes, please Contact us via private message 👍👍👍🌼🌼🌼💃🏽💃🏽💃🏽 По проведению Мастер-классов, Постановок и Индивидуальных занятий Свяжитесь со мной В личном сообщении 👍

BBC Learning English

@english_bbc_learning · Post #3776 · 29.11.2025 г., 10:17

You know when somebody just WON’T change their ways? 😠 We’ve got an English expression for that! ✅ ⁣ ⁣ Scroll through the images to find out how to use ‘You can’t teach an old dog new tricks.’ ❌🐶 ⁣ ⁣ Can you use it in a sentence – and do you have a similar expression in your language? 👇👇👇⁣ ⁣ MORE: If you'd like to learn some more animal idioms, like 'rabbit on 🐰' or 'as sick as a parrot 🦜', click the link in our bio! ⁣ ⁣ Image: Getty⁣ ⁣ #trick#proverb#learnenglish#vocabulary#learnenglish#englishlanguage#expression#idiom#englishclass#speakenglish ⁣