Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
🎉 It Finally Happened: SEC Approves SPOT BTC-ETFs! 🚀
💡What This Means: SPOT BTC-ETFs let investors get into Bitcoin through more traditional investment avenues. This brings in more investors and makes the crypto market more like the traditional financial market.
🤝Join SLEX Exchange, catch the bull run wave, and trade Bitcoin to boost your earnings on the spot market!
#CryptoNews#SECBTCETF#Bitcoin#CryptoAdoption#FinancialMileston
Website| Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter
🚀 Polygon Stablecoin Supply Hits Record High of $3.6 Billion
The stablecoin supply on the Polygon network has reached a new peak, totaling $3.6 billion. According to NS3.AI, this milestone was confirmed by data from Artemis, indicating that the network has achieved an all-time high in stablecoin holdings. This development highlights the growing adoption and utilization of stablecoins within the Polygon ecosystem.
#Polygon#Stablecoin#Crypto#Blockchain#DeFi#Cryptocurrency#DigitalAssets#CryptoAdoption#CryptoNews#FinTech#POL
Bitcoin Rise and Market Liquidations
Bitcoin reaches $94,000, indicating market volatility. In 24 hours, $655 million liquidated from crypto assets. USDt-TON sees accelerated growth: over 1 billion issued and integrated with major exchanges. Telegram adoption boosts usage, making crypto accessible to 950 million users. Read more on market events and USDt-TON's progress through Watcher Guru and other sources.
#Bitcoin#Crypto#USDC#USDt-TON #TON#Telegram#WhaleAlert#MarketTrends#Liquidation#Blockchain#Stablecoin#Investing#Altcoins#VentureCapital#FinTech#Web3#DataAnalysis#CryptoAdoption
U.S. Must Lead in Crypto Regulation
U.S. Treasury Secretary Bessent emphasizes the need for the U.S. to take a global lead on cryptocurrency. Key points include bringing Bitcoin transactions onshore and ceasing government Bitcoin sales. Notably, the evolving regulatory landscape also aims to foster greater adoption of cryptocurrencies in the U.S.
#Crypto#U.S. #Bitcoin#Regulation#SEC#BTC#Blockchain#Innovation#CryptoAdoption#Finance#Bessent#Investment#CryptoPolicy#DigitalAssets#Mainstream#MarketTrends#Tech
Uniswap Expands Crypto-to-Fiat Options
Uniswap collaborates with Robinhood, MoonPay, and Transak to enable seamless crypto-to-fiat transactions. Users across 180+ countries can convert crypto and deposit funds directly into bank accounts via the mobile wallet. This feature will soon be available on the browser extension and web version. For more details, visit Leviathan News.
#Uniswap#Crypto#Robinhood#MoonPay#Transak#Banking#Fiat#DEX#Blockchain#Finance#Tech#Global#Innovation#Payments#Wallet#Transactions#Defi#Onboarding#CryptoAdoption#VC
🚀 Bitcoin Bancorp Expands Bitcoin ATM Network in Southern California
Bitcoin Bancorp has announced the launch of a licensed Bitcoin ATM network in Southern California, with the first machines now operational in the Los Angeles area. According to Odaily, this marks a new phase in the company's retail expansion in the United States, following its previous deployment in Texas, highlighting its strategy to accelerate growth in key markets.
Data indicates that the United States currently hosts over 35,000 Bitcoin ATMs, with the industry expected to grow from approximately $267 million in 2025 to $7.68 billion by 2034. California, with its large population, advanced tech ecosystem, and high rate of cryptocurrency adoption, is a significant growth market, ranking among the top states in the nation for ATM installations, second only to states like Texas.
#BitcoinBancorp#BitcoinATM#SouthernCalifornia#LosAngeles#RetailExpansion#Cryptocurrency#BitcoinMarket#CaliforniaTech#CryptoAdoption#USBitcoinATMs#ATMInstallations#BitcoinGrowth#BTC