Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#NULS/USDT analysis :
#NULS is currently in a bearish trend, trading below the 200 EMA and consistently making new lows. The price is testing the 200 EMA, with expectations of a rejection at this level, which will lead to a continuation of the bearish momentum and the formation of new lows.
TF : 4h
Entry : $0.2760
Target : $0.2150
SL : $0.3145
#NULS/USDT analysis :
#NULS is currently in a downtrend, establishing lower lows (LLs) and lower highs (LHs) below the 200 EMA. The price has retraced to the resistance zone, and it is anticipated that it will continue its bearish momentum, potentially testing lower levels.
TF : 4h
Entry : $0.2996
Target : $0.2667
SL : $0.3230
#NULS/USDT analysis -
#NULS is trading in a downtrend below the 200 EMA. The price is currently declining from resistance zone and is expected to test the support zone soon.
TF : 1H
Entry : $0.3080
Target : $0.2840
SL : $0.3246
#NULS/USDT analysis -
#NULS is in an uptrend, trading above the 200 EMA. After the breakdown of the previous swing high, the price is now sustaining this level and is expected to continue its bullish momentum to test new highs.
TF : 30min
Entry : $0.3237
Target : $0.3479
SL : $0.3171
#NULS result
2 nd target achieved in just 2 days ✅✅
One more huge quick profit 32%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for membership and grab next breakout signal
#NULS result
1 st target achieved in just 6 house ✅✅✅
One more huge quick profit 6.3%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for membership and grab next breakout signal
#NULS result
1rd target achieved in just 16 house ✅✅✅
One more huge quick profit 5%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for premium membership and grab next breakout signal
📉 Today the market is in a slight correction. This is good for me.
Any price drop, I regard as an opportunity to buy cryptocurrency at a good price.
Today I add to my portfolio - NULS (#NULS).
Bought it for $ 10, on the largest crypto-exchange Binance.
🎯 Long term investment.
The Motive to buy:
#NULS is ranked 168 in the CoinMarketCap rating.
The coin was not pumped! The price has retested the support zone of $0.2125-0.3798 and moves to the resistance zone of $1.1065-1.3249.
To continue the growth, it is necessary to consolidate above $1.3250.
Price projector points to growth towards $2.15.
🚀 Expected to grow from 85% to 460%.
😱 You can see my previous investment result here - https://bit.ly/30GlvN2