Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#SNX/USDT analysis :
#SNX is currently retracing towards the support zone following a recent impulsive move. It is anticipated that after a breakout from this zone, the price will retest and subsequently bounce back, resuming its bullish momentum.
TF : 1D
Entry : $2.0
Target : $3.4
SL : $1.5
#SNX/USDT analysis :
#SNX has broken and retested the support zone, and it is currently facing resistance from the 200 EMA. The price is likely to continue its bearish momentum from its current level and retest previous lows.
TF : 4H
Entry : $1.353
Target : $1.229
SL : $1.430
#SNX🐻👀
A little bit risky but will worth to try. Use SL.
Want to see more strategies for any coin? Check out CoinLegs in order to have an overview before your trades 📊
UNBELIEVABLE PROFIT OF 23,600% HAS BEEN REALIZED IN #SNX
🔀
We're made a massive 2️⃣3️⃣6️⃣🔤 profit this Trade 🤑🔥
If you had only $50 inthis single position you would've made $11,800⭐
Went from 7,910% to 23,615%—That’s an extra 15,705% profit just by holding for maximum gains🥂🔥
If you're someone who's been following our progress, but haven't yet joined the PREMIUM group, what's holding you back? You can see the consistent profits we're making on a regular basis. The only difference between you and the members who send us the positive feedback you see, is that they took action and joined the PREMIUM group.
It's business as usual - every day, like clockwork, we are in the fast lane, leaving the competition eating our dust
😮💨🪙
If you are ready to step up, send me a message and let's get started 👇
@Kevindexter✅
🔀#SNX/USDT 2,170% profit, insane move! 🤯
That’s 2️⃣1️⃣🔤 gain on your money 💰🔥
💰$50 would return $3600💸
💰$50 would return $1,085💎
💰$50 would return $1,085💎
Fast & solid results—that’s what we love the most. Any guesses on who’s missing out again? 🤔
Enjoy 2,170% profit🆙. 🤝Congratulations all Premium Members.
Now imagine if you followed the rest of the signals.. 🤑💯
chat to join
➡️@Kevindexter✅️