Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🚀 Back to Back profits are made in the Premium Group
🎯🎯#DUSK/USDT has covered all the target to give a Profit of 22% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain
🚀🚀Raining Profits in the Premium Group
🎯🎯#DUSK/USDT has covered all the targets to give an amazing profit of 75% for all Premium Members
👁🗨Contact @futurechief to enter the premium group & make daily gains on Futures as well as Spot Market
🎯🎯Excellent 23% Profit on #DUSK/USDT for all Premium Members
🚀🚀It has crossed all the targets
👁🗨Contact @futurechief to enter the premium group & make daily gains
#DUSK/USDT analysis :
#Dusk is currently in a downtrend and making new lows. The price has broken below support and is anticipated to resume bearish momentum and test lower levels. Wait for a retest of the broken support for a short entry opportunity.
TF : 1D
Entry : $0.1062
Target : $0.0730
SL : $0.1280
#DUSK/USDT analysis :
#DUSK is currently attempting to break through the trendline and rise higher to test the previous swing high. The price has formed a double bottom pattern within the support zone, which further indicates the potential for upcoming bullish momentum. It is advisable to wait for the price to break the trendline before considering a long entry.
TF : 1D
Entry : $0.1910
Target : $0.2520
SL : $0.1508
😳#DUSK +60% за 3 дня!
Dusk — Layer-1 блокчейн с Zero-Knowledge proofs (ZK-SNARKs) для полной приватности транзакций и смарт-контрактов. Поддерживает конфиденциальную токенизацию реальных активов (RWA), DeFi и торговлю с встроенной регуляторной совместимостью (MiFID II, MiCA).
Токен доступен: MEXC
Crypto Headlines
#DUSK/USDT analysis :
#DUSK is currently consolidating within a channel. The broader trend on larger timeframes suggests a bearish outlook, indicating a possible breakout from the channel to further descend towards lower price levels. It is recommended to await a breakout from the channel and a drop below the $0.1932 level before considering entering a short position.
TF : 4H
Entry : $0.1932
Target : $0.1508
SL : $0.2195
🚀🚀 20% Profit on #DUSK/USDT for our Premium Members on Binance Futures/Bybit/OKXX/Kucoin/Bitget
✅✅ All target completed
👁🗨Contact @primemod to enter the Premium Group for high quality SPOT & FUTURES Signals
🚀🚀 525%+ Huge Profit on #DUSK/USDT as it has hit all the profit target with great easiness - The trade has been closed today
👁🗨Contact @primemod to enter the premium group & make daily gains
🚀🚀 590%+ Huge Profit on #DUSK/USDT as it has hit all the profit target with great easiness - The trade has been closed today
👁🗨Contact @primemod to enter the premium group & make daily gains