Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
✨Level up and unlock daily cash rewards, up to $2,100!
🎉
Upgrade your level to grab massive rewards! 🔝The more you upgrade, the better your chances to win!
➡️How to participate
Join Vanilla Finance
Be at level 8 or above.
Upgrade at least 1 level during the event.
🎲Winner Selection
Winners will be randomly selected. Probability increases based on the amount paid for level upgrades.
🏆Daily Rewards
🥇 $100 — 1 winner
🥈 $50 each — 2 winners
🥉 $15 each — 7 winners
🎙Winner Announcement
Winners will be announced every 6:00 UTC on Vanilla finance's official TG channel✔️
📆Event Period: Nov 19, 9:00 — Nov 25 9:00 UTC
Rewards will be distributed every day after the winner announcement.
🍦Ready to be the lucky winner?🏆
#TON#contest#VanillaFinance
🍦 Join Vanilla Finance Huge Community Giveaway!
Share 💵10,000 worth of USDT prize pool!
✔️Complete all daily tasks to win big!
✔️RT & Like on X
✔️Tag 3 Frens on X
🗓️ May 21-27, 2025 (8:30PM GMT+8)
Start on Galxe✔️
#VanillaFinance#Giveaway#TON
😊Memecoin Spot Trading is Now Live on Vanilla Finance on Telegram!
Start spot trading your favorite memecoins on #VanillaFinance today! The #1 Trading Volume exchange on Telegram.
We’re the 1st Exchange to bring you:
🪙 Memecoin Spot Trading
⚡️ 10,000x Leverage
❌ No Liquidation Risk
↗️ Exciting memecoin trading events are on the way! Stay tuned for upcoming massive reward events 🎁
❤️ Join Vanilla mini-app now and try spot trading!
#meme#miniapp#telegram#web3
🍦Vanilla Finance: Project Updates
Vanilla Finance announced that its TGE has been postponed to Q2 2025.
According to the team, this decision was made due to unfavorable market conditions and aims to ensure the most successful launch possible. The extra time will allow them to refine the Total Return Swap (TRS) product, which developers believe can become a cornerstone of DeFi infrastructure and unlock new income opportunities.
In preparation for the TGE, the team is also deepening cooperation with leading centralized exchanges and forming partnerships with players such as #CoinMarketCap and BNB Chain by participating in their MVB and CMC Labs programs.
🍦Mini-app
#TGE#CMC#VanillaFinance
❤️Vanilla Finance Closes Pre-Seed Investment Round ✔️
Singapore, November 26, 2024 – Vanilla Finance, the leading exchange by trading volume on #Telegram, has announced the successful closure of its Pre-Seed investment round. Spearheaded by industry giants like Paper Ventures, UOB Ventures, and ABCDE Labs, the round also attracted notable participants such as #HTX Ventures, #Ocular, #Openspace, #Y2 Ventures, and angel investors from #STEPN, #Scroll, #XAI, and more.
🔫A Game-Changer in the Digital Asset Space
Since its launch, #VanillaFinance has made waves, amassing over $8 billion in USDT trading volume within just 60 days. This meteoric rise is further validated by winning the prestigious #Binance MVB Season 8, a recognition of the platform’s cutting-edge solutions and market leadership.
👏Visionary Growth and User-Centric Innovation
With fresh funding and institutional backing, Vanilla Finance is on a mission to redefine crypto trading by:
• Simplifying User Experience: Introducing intuitive, secure features tailored for both novices and experts.
• Expanding Offerings: Launching a spot market, with a focus on meme trading pairs, and rolling out features like a meme creator platform, staking products, and futures trading.
• Regional Focus: Targeting Southeast Asia and APAC with localized services, multilingual support, and integration with regional payment systems.
💰Institutional Confidence in a Bright Future
The involvement of strategic investors highlights Vanilla Finance’s potential. A UOB Ventures spokesperson praised the platform’s innovative approach, while Danish Chaudhry of Paper Ventures noted, “Vanilla Finance’s expansion aligns perfectly with the Southeast Asia and APAC markets’ untapped opportunities in digital finance.”
📖Building a Next-Generation Ecosystem
Beyond trading, Vanilla Finance is creating an ecosystem that prioritizes community engagement and innovation. With its unique approach to meme trading and user-focused features, the platform is poised to set a new benchmark in digital asset trading.
✈️The Future Starts Here: Vanilla Finance is committed to serving the next 100 million users, shaping a more inclusive, engaging, and forward-thinking crypto landscape.
❤️ Join Vanilla mini-app now and get as much $CONE as you can before the airdrop!