Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#APE/USDT analysis :
#APE is currently demonstrating a bullish trend, characterized by higher highs and higher lows, with strong support along the trendline. The price has recently bounced back and successfully broken out of the trendline, suggesting a continuation of bullish momentum. It is anticipated that the price will test previous highs moving forward.
TF : 1D
Entry : $1.330
Target : $1.930
SL : $0.988
#APE/USDT analysis :
#APE is currently in an upward trend, consistently achieving new highs while trading above the 200-period exponential moving average (EMA). The price is currently consolidating above a support zone that has been tested multiple times. It is expected that the price will bounce off this level and continue its upward trajectory, with the potential to revisit previous highs.
TF : 30min
Entry : $1.890
Target : $2.160
SL : $1.760
#APE/USDT analysis :
#APE is currently in a downtrend, trading consistently below the 200 EMA. The price is currently within a resistance zone. It is anticipated to face rejection from this zone and continue its downward trajectory.
It is advisable to await the breakout of the $0.580 level for a short position, with the previous swing low likely to be tested.
TF : 30min
Entry : $0.580
Target : $0.537 and $0.509
SL : $0.607
📈Инсайдер «0x0b8a» превратил $174 000 в $2,45 млн (14x) всего за один день
Он открыл лонг по #APE прямо перед ростом цены и вышел почти на самом пике, зафиксировав $1,79 млн. Сразу после этого открыл шорт и заработал еще $488 000 – lookonchain.
🟪Чат▫️Новостной канал▫️Премиум сигналы
#APE
ApeCoin is completing a cup and handle formation on the daily chart🧐
Also, the price has breached above the descending resistancelevel and the MA 50
A move above the neckline could drive the price toward targets at $0.85, $1.00, $1.20, and $1.36🚀
#APE
ApeCoin is moving towards a key resistance level, showing potential for a significant move
A breakout from the descending channel could trigger a 100-120% bullish wave in the mid-term️