Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
#HOT/USDT analysis :
#HOT has broken and retested the support levels, which are now acting as resistance for the price. The price is currently in a downtrend on the higher timeframe and is expected to continue its momentum from the current level.
TF : 1H
Entry : $0.00135
Target : $0.00123
SL : $0.00142
#HOT/USDT analysis -
#HOT is currently consolidating sideways above a support line. The price has tapped into liquidity from previous lows below the support line. It appears poised to move upwards, with the previous high as the target level.
TF : 5min
Entry : $0.00145
Target : $0.00150
SL : $0.00143
#HOT/USDT analysis -
#HOT is currently on a downtrend, trading below the 200 EMA. At the moment, it's experiencing a pullback and has retraced to previous support levels near the 200 EMA. The price is encountering resistance near the 200 EMA and appears poised to start moving downwards. It's likely that the price will test previous lows in the near future.
TF : 1h
Entry : $0.00184
Target : $0.00162
SL : $0.00201
4834 new target 5000 🔥
🔥Claim/198 activationsFiredrop 0.25 HOT
How to claim:
╔•1.Join our village.
╠•
╚•2.Subscribe claim 0.25 HOT
🎁Gifts, NFTs, stars, premium Telegram, crypto airdrops, and tokens like 🔥HOT and more! Premium 👥VIP status! Join and win every day!
#hot
#HOT rejected from the ceiling of supply zone on 3D Time frame,it can bounce again from the Green zone, everything is bullish now
📈
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
🪙1853 new target 2000 #HOT🔥
How to claim:
1) Join our village.
2) Follow @ChatCryptoTON
🔥Claim 170/288 activationsFiredrop0.15 HOT
🔥Claim/88 activationsFiredrop0.25 HOT