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

Пребарај: #seedfunding

当前筛选 #seedfunding清除筛选
Crypto M - Crypto News

@CryptoM · Post #65173 · 11.04.2026 г., 16:05

🚀 USDi Stablecoin Seeks $1.5 Million in Seed Funding Amid Rising Inflation USDi, a stablecoin already in circulation, is aiming to secure approximately $1.5 million in seed funding. According to NS3.AI, the token is designed to track the U.S. Consumer Price Index (CPI) and is intended to increase in value with inflation, rather than maintaining a fixed nominal value of $1. Michael Ashton highlighted that the initiative comes at a time when U.S. inflation has surged to 0.9% in the past month, primarily due to energy costs linked to the ongoing conflict in Iran. #USDi#Stablecoin#SeedFunding#Inflation#CPI#EnergyCosts#IranConflict

Venture Village Wall 🦄

@venturevillagewall · Post #4108 · 09.02.2025 г., 19:00

End Chokepoint 2.0 Now! Senator Lummis urges that personal beliefs regarding guns, #Bitcoin, crypto, and religion should not affect banking practices, calling for an end to Chokepoint 2.0. In other news, Coala Pay secures $3.50M in Seed funding led by Castle Island Ventures, alongside participation from Lattice Fund and Factor Capital. Read more here: ICO Analytics #Bitcoin#Crypto#VC#Banking#Funding#Chokepoint2.0 #Politics#SenatorLummis#InternationalAid#CoalaPay#Investing#SeedFunding

Crypto M - Crypto News

@CryptoM · Post #64994 · 10.04.2026 г., 13:15

🚀 SimpleChain Secures $15 Million in Seed Funding for RWA Network SimpleChain has announced the successful completion of a $15 million seed funding round. According to Foresight News, the funding was supported by family offices and institutional investors. SimpleChain aims to develop a Real World Asset (RWA) Layer 1 network, positioning itself as an 'Institutional OS' for RWA. The network will be powered by Granular Data and native CaaS, focusing on providing financial-grade infrastructure for the tokenization of real-world assets globally. #SimpleChain#SeedFunding#RWA#Layer1Network#InstitutionalOS#GranularData#CaaS#Tokenization#RealWorldAssets#FinancialInfrastructure

Venture Village Wall 🦄

@venturevillagewall · Post #4142 · 13.02.2025 г., 16:00

Teneo Raises $3M for Decentralized Platform Teneo, a decentralized data utilization and tokenization platform (formerly ELOOP), has secured $3M in Seed funding led by RockawayX and Borderless Capital. Ethereum L1 users spent $570M in January 2025, showcasing active economic engagement. Additionally, Plasma raised $24M to launch a blockchain for Tether, enabling zero-fee USDT transactions. Read more: Tokenterminal | Fortune #Teneo#Blockchain#Funding#Plasma#Ethereum#DeFi#Crypto#Tokenization#SeedFunding#NEIRO#USDT#EVM#Web3#Bitcoin#Solana#Investments#VC#EconomicActivity#DigitalAssets#Stablecoin

Venture Village Wall 🦄

@venturevillagewall · Post #3431 · 18.12.2024 г., 14:33

Silencio Raises $2.5M in Seed Funding Community-focused network Silencio, tackling noise pollution, secures $2.5M in Seed funding led by Blockchange Ventures, with contributions from Borderless Capital, Master Ventures, Blockchain Founders Fund (BFF), Prosper GmbH & Co. KG, and Advanced Blockchain AG. #Silencio#Fundraising#NoisePollution#SeedFunding#BlockchangeVentures#BorderlessCapital#MasterVentures#BlockchainFoundersFund#ProsperGmbH#AdvancedBlockchainAG

Venture Village Wall 🦄

@venturevillagewall · Post #4255 · 26.02.2025 г., 22:00

Major Crypto Hacks and Market Updates Bybit suffers $1.4B ETH hack, among largest ever, surpassing Mt. Gox and FTX. NVIDIA posts strong Q4 FY25 results; expects $43B Q1 FY26 revenue. Bitcoin drops to $82,236, with over $433M liquidated. Bank of America set to launch its own dollar stablecoin, joining other major banks in the crypto finance space. Donald Trump's tariffs may impact Bitcoin prices. #Crypto#Bitcoin#ETH#NVIDIA#Hack#Stablecoin#MarketManipulation#Finance#BankOfAmerica#Tariffs#Liquidity#Tech#USDC#USDT#Aegis#Truesense#Ligero#SeedFunding#VC#AI

Venture Village Wall 🦄

@venturevillagewall · Post #4032 · 30.01.2025 г., 19:00

Cedar Money Raises $9.90M in Seed Funding 📈 Cedar Money, a stablecoin-powered payments platform, has secured $9.90M in a Seed funding round led by QED Investors. The funding aims to enhance cross-border payment solutions using digital assets. 💰 Other funding highlights include: - McQueen Labs Inc. raised $1.16M for luxury car investments. - Irreducible raised $24M for ZKP acceleration. - Mevvy secured $2.80M for MEV execution. - Clipper acquired by Sushi Labs. 🇨🇿 In a groundbreaking move, the Czech National Bank is considering investing up to 5% of its €146 billion reserves in bitcoin, making it the first Western central bank to officially do so if approved. 🔗 Read more about Cedar Money at ICO Analytics. #CedarMoney#SeedFunding#Stablecoin#Crypto#Bitcoin#CzechRepublic#Investment#Fintech#Payments#DigitalAssets#McQueenLabs#Irreducible#Mevvy#SushiLabs#VC#Innovation#Economy#Blockchain#Regulation#FundingRound