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

Пребарај: #businessstrategy

当前筛选 #businessstrategy清除筛选

Marketing rejalarini ishlab chiqish va boshqarish mavzusida mahorat-darsi bo‘lib o‘tdi 🇺🇿 Biznes va Tadbirkorlik oliy maktabi tinglovchilari mehmon ma’ruzachi Kadirov Sarvar Sabirovich boshchiligida «Marketing rejalarini ishlab chiqish va boshqarish: strategiyadan amaliy natijagacha» mavzusidagi mahorat-darsida ishtirok etdilar. Uchrashuv davomida tinglovchilar marketing rejasini to‘g‘ri tuzish bosqichlari, bozor va mijozlarni tahlil qilish usullari, marketing byudjeti samarali taqsimlash hamda KPI asosida natijalarni baholash haqida ma’lumot oldilar. Real biznes misollari orqali strategiyaning amaliy natijaga qanday aylanishini ko‘rish imkoniga ega bo‘ldilar. Mahorat-darsi tinglovchilarga nazariy bilimni amaliy tajriba bilan bog‘lash imkonini berdi. 🇷🇺RU 🇬🇧ENG #GSBE#GraduateSchool#Masterclass#MarketingPlan#BusinessStrategy 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

⚡️Hurmatli professor-o‘qituvchilar, tinglovchilar va mehmonlar! Sizlarni “Marketing rejalarini ishlab chiqish va ularni boshqarish: strategiyadan amaliy natijagacha“ mavzusida navbatdagi mahorat-darsi uchrashuviga taklif etamiz. Dasturimiz mehmon maruzachisi ALYANS AUTO kompaniyasining marketing, savdo va servis bo‘yicha Bosh direktor o‘rinbosari - Kadirov Sarvar Sabirovich. 📌 Mahorat darsida ishtirokchilar quyidagi bilim va ko‘nikmalarga ega bo‘ladilar: ☑️ Marketing rejasini to‘g‘ri tuzish bosqichlari; ☑️Bozor va mijozlarni amaliy tahlil qilish usullari; ☑️ Marketing byudjetini samarali taqsimlash; ☑️ KPI va natijani o‘lchash mexanizmlari; ☑️ Rejani bajarishni boshqarish va nazorat qilish; ☑️ Real biznes misollari asosida tahlil va tavsiyalar. 🇺🇿 Tadbir o‘zbek tilida olib boriladi. 🗓Sana: 23-fevral, 2026-yil ⏰Vaqti: 9:00-10:30 📍Manzil: Biznes va tadbirkorlik oliy maktabi. Toshkent shahri, Mirobod tumani, Mirobod ko‘chasi, 25-uy. (5-qavat, 4-auditoriya) ☎️Telefon: +998 91 163-51-15 🇷🇺RU 🇬🇧ENG #GSBE#GraduateSchool#Masterclass#MarketingPlan#BusinessStrategy 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

Crypto M - Crypto News

@CryptoM · Post #65100 · 11.04.2026 г., 01:16

🚀 Nansen CEO Highlights Importance of Corporate Culture for AI Agents PANews posted on X (formerly Twitter). Nansen CEO Alex Svanevik has emphasized the necessity of establishing a corporate culture for AI agents to enhance their collaboration within companies. According to Svanevik, relying solely on prompts and skills is insufficient for effective AI integration. He suggests that defining default behaviors, communication standards, and shared values is crucial for AI agents to work effectively alongside human teams. Svanevik believes that just as corporate culture boosts human team efficiency, it can similarly benefit AI agents. #AI#CorporateCulture#AIAgents#Teamwork#Innovation#Leadership#BusinessStrategy#Technology#Collaboration#WorkplaceCulture

Venture Village Wall 🦄

@venturevillagewall · Post #4096 · 08.02.2025 г., 07:00

Musk's Ambition vs. Reality Check Elon Musk emphasizes ambitious startups to change the world, yet he admits to founding zip2 for profit. To fund his dream of space travel, he aimed for quick cash during the dot-com boom, leveraging simple tech ideas. His success in early startups paved the way for SpaceX and Tesla, which he financially supported himself. The takeaway? Most need to start with smaller, realistic goals before tackling grand visions. Key Insights: - Musk's journey began with profit-seeking. - Early startup success critical for later ventures. - Most should follow the first step before the grand vision! 📉AI tokens market caps drop by $14B in three weeks, now at $6.2B. Read more: News #AI#Crypto#VC#Musk#Startups#SpaceX#Tesla#Entrepreneurship#Innovation#Technology#Investment#MarketTrends#AItokens#DotcomBubble#Funding#BusinessStrategy#Profit#Success#Wealth

Venture Village Wall 🦄

@venturevillagewall · Post #3444 · 19.12.2024 г., 11:44

Avoid Copycat Mistakes Copying strategies without understanding their context can harm startups. From the experience of a former CTO, mindless imitation of established B2B products leads to failure. Large companies aim to protect their gains, while startups focus on growth. Analyze original strategies instead of copying them blindly. Discover more about proper implementation in the provided link. #Startup#B2B#SaaS#Strategy#Growth#Analysis#Innovation#Business#Entrepreneurship#CTO#Imitation#Failure#Success#Marketing#Learning#Education#BusinessStrategy

Venture Village Wall 🦄

@venturevillagewall · Post #3608 · 21.12.2024 г., 07:13

Disrupting Subscription Models A potential billion-dollar startup aims to revolutionize content sales by eliminating subscription models that frustrate users wanting single purchases. Currently, 70% of subscribers cancel within 3-6 months, while content sellers hesitate to switch to one-time payments due to lower profitability. Innovations in this direction could lead to significant market changes. More details here: Fast Founder #Startup#ContentSales#SubscriptionModel#UserExperience#BusinessStrategy#MarketInnovation#OneTimePayment#Profitability#UserRetention#Ecommerce#RevenueModel#Disruption#TechStartup#Media#DigitalContent#OnlineSales#Fintech#Investments#Entrepreneurship#InnovativeIdeas