Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
Hello everyone!
Our guest speaker for today is sick, so Today, we will have a shorter version of our weekly 19:00 chat session. It will be solely focused on YOUR questions to us. Let’s practice your English!!! 💬🇺🇸
We are looking forward to connecting with you in 15 minutes!
#SPEAKENGLISH#QandA
🦵 Here are 5 English phrasal verbs with ‘kick’ for you. Kick back and read them and then have a go at the quiz – and see if you can use any of them in a sentence of your own! (Images: Getty)
#vocabulary#speakenglish#englishtips
We are super excited for you to meet our friend, Bekzod Kholmurodov, an Uzbekistan-born sophomore student at Drexel University, USA this Saturday, at 19:00 Tashkent time! Don’t miss this unique opportunity to learn from someone who has an invaluable experience of coming to the US as an international high school student first, and now is a college student as a El-Yurt Umidi scholar!
Invite your friends and get your questions ready!!
#UzbeksInAmerica#SpeakEnglish#OneStepAtATime
🇺🇸🤝🇺🇿
🥊 There are quite a few English phrasal verbs with ‘hit’ – here are 5 of them to learn and use. 👋 Have a go at the quiz – and see if you can use any of them in a sentence of your own! (Images: Getty)
Extra: Click on our link in bio to learn 4 phrases with 'hit'.
#learnenglish#vocab#vocabulary#speakenglish#englishtips
Let’s be real: You’ve probably seen a list like this 1,000 times. It looks repetitive, maybe even "dumb." But here is why it actually matters for you:
When you only have one word for everything (like "Good"), your brain "glitches" when you're trying to speak fast. You hesitate because you're searching for variety but your "vocabulary folder" is empty. 🧠
The Secret to Speaking Fast:🛫
Fluency isn't about knowing the hardest words; it's about having options. When you have 3-4 ways to say the same thing, your brain doesn't have to stall. It just picks the next available word and keeps the flow going.
-
#English#SpeakEnglish#EnglishTips#Vocabulary#SpokenEnglish
Group: English Chatting House | Global English Speaking Chat
Members: ~4.48K
💢 Username: @english_chatting_house
Description:
⭐ Welcome to ECH! English only - global English chat, spoken English practice, fun talks & chill worldwide vibes. Talk English, meet international people, improve fluency, keep it clean. No beef, no hate, no promo. Got any queries? :- @Bilxerian
🏷 Tags: #languages
#learnenglish#englishchat#speakenglish#englishgroup#globalchat
https://telegramchannels.me/groups/english_chatting_house
Idiom of the Day!
🚌 Throw someone under the bus
Meaning: To blame someone else so you don't get in trouble.
Example: "Mark made the mistake, but he threw me under the bus!" 😠
#LearnEnglish#EnglishIdioms#Vocabulary#ESL#EnglishPhrases#SpeakEnglish
Do you know someone who always thinks that everyone else has a better life than them?! 🙄😅 Scroll through the images to find out how to use ‘the grass is always greener on the other side’ 🌱, and don’t forget to answer the questions on the last slide!
EXTRA: Could walking 7,000 steps a day could improve your mental health? 🚶 Click the link in our bio to find out and learn some useful vocabulary in the process! 📰💚
Image: Getty
#vocabulary#learnenglish#englishlanguage#expression#idiom#proverb#englishclass#speakenglish
You know when somebody just WON’T change their ways? 😠 We’ve got an English expression for that! ✅
Scroll through the images to find out how to use ‘You can’t teach an old dog new tricks.’ ❌🐶
Can you use it in a sentence – and do you have a similar expression in your language? 👇👇👇
MORE: If you'd like to learn some more animal idioms, like 'rabbit on 🐰' or 'as sick as a parrot 🦜', click the link in our bio!
Image: Getty
#trick#proverb#learnenglish#vocabulary#learnenglish#englishlanguage#expression#idiom#englishclass#speakenglish
Here are 5 linkers that you can add to your conversation to make it flow better and sound more fluent!
1) To be honest – I’m going to give my opinion (even if it’s insulting!)
2) Actually – to correct information or say something surprising
3) Mind you – I’ve just thought of something that contrasts what I was saying
4) By the way – I’m going to introduce a new topic I’ve just remembered
5) Anyway – I’m going to finish the conversation or change topic now
Add them to your conversations to help them flow! Which one is your favourite?
#learnenglish#speakenglish#vocabulary#bbclearningenglish#britishenglish#formalenglish#linkers#naturalenglish#nativespeakerenglish#conversationskills#ncoversationalenglish
🚀 Power up your English vocabulary with these FIVE phrasal verbs with ‘pay’! Take a look 👀 and then practise using them right now in the comments! 🤔 Do you know any more phrasal verbs with ‘pay’?
(Images: Getty)
🎧 Click on the link in our bio to listen to Neil and Georgie talk about money!
#phrasal#phrasalverb#pay#payoff#payout#payup#payfor#learnenglish#vocab#vocabulary#speakenglish#englishtips