Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#DGB/USDT analysis :
#DGB is expected to retest the 200 EMA before continuing its bearish trend. This creates a potential buying opportunity on lower time frames (LTF), and the current level is a good point for long trades.
TF : 4H
Entry : $0.00865
Target : $0.00970
SL : $0.00797
#DGB/USDT analysis :
#DGB is currently in a downtrend, consistently making new lows while trading below the 200 EMA. The price is now showing a retracement towards the 200 EMA and the resistance zone. It is expected to reverse and continue its bearish momentum. It is recommended to wait for the price to retest this zone and demonstrate rejection before considering a short entry.
TF : 1D
Entry : $0.00703
Target : $0.00541
SL : $0.00814
#DGB/USDT analysis :
#DGB has broken the support levels and has retested the zone, which is now acting as resistance for the price. The price is expected to decline from this level and test the previous swing low.
TF : 4H
Entry : $0.00662
Target : $0.00634
SL : $0.00681
#DGB/USDT analysis -
The current price movement of #DGB shows a rejection from the resistance zone after establishing a lower low. There is an anticipation of further decline from this point with a potential retest of the previous low. To effectively manage risk, it is advisable to set a stop loss above the rejection zone.
TF : 1h
Entry : $0.00716
Target : $0.00616
SL : $0.00757
#DGB👀
The second chart fully and automatically generated by our algorithm 🤖
All drawings are based on only mathematical values and calculations instead of emotions.
Interested? Check out www.coinlegs.com
#DGB hit 34 today 🔼
Trade opened on 24 March ✨
In both spot n future
Join team @CryptoProfitCoach🔝
⭐⭐ Lifetime Membership opened for a limited time⭐👈👇👇
🟥Multiply your wealth into multiple folds and Get Unique opportunity to trade with @CryptoProfitCoach
✨Buy when he buy sell when he sell...Know what Gem he holding✨
Join team @CryptoProfitCoach🟥
for mega gains and multiply your wealth
✅ Get personalized attention in every trade
✅More trades and Mega profits.
✨ Inside info/Secret info of Coin
✅No.1 Pump Tracking Services.
✅ High End Profit Targets
✅ 24x7 Support in all trades
✅ Get Entry n High end profit Exit with Team in every trade
✨Discounted price -500$ for a year with 24x7 chat support ✅
✨Today's decision can change your tommorrow✨
https://forms.gle/U519Ye8sCmvVE2Pv9
🟥Click here 👆👆✨✨