TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в 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

Резултати

Пронајдени 3 слични објави

Пребарај: #usefuilanguage

当前筛选 #usefuilanguage清除筛选
English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #60507 · 16.11.2025 г., 19:02

#usefuIlanguage #useful_excerpt ☁️Using substances as a coping mechanism is like putting a band-aid on a bullet wound; it might momentarily mask the pain, but it doesn't address the root problem and often exacerbates it. 💥Put a band-aid on a bullet wound : (idiomatic, informal) To inadequately treat a serious situation. 💥Exacerbate: To make worse

English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #60272 · 18.09.2025 г., 17:37

#usefuIlanguage #useful_excerpt ○°°°○°°°○°°°○ ◇◇◇"Oh dear, life is pretty tough sometimes, isn't it?" And Nat took his head in both hands. . . ."Very tough, but it is that very struggle with obstacles which does us good. Things have been made easy for you in many ways, but no one can do everything. You must paddle your own canoe now." ○°°○To paddle your own canoe: ☆(idiomatic) To independently make the decisions or perform the duties, tasks, etc. which are one's own responsibility and which affect oneself. ○°°°°°○°°°°○

English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #60262 · 16.09.2025 г., 07:19

#SpokenEnglish #usefuIlanguage 💥"I'm only razzing you!" ⚡️This phrase is often used in informal contexts to indicate that someone is joking or teasing another person in a playful manner. It suggests that the teasing is not meant to be taken seriously or to hurt feelings. ⚡️If a friend playfully mocks your choice of movie, you might respond with, "Oh, come on! I'm only razzing you!" 💥 "You do you!" ⚜This expression is a way of encouraging someone to be themselves and to pursue their own interests, choices, or lifestyle without worrying about what others think. It promotes individuality and self-acceptance. ⚡️If someone is hesitant about wearing an unconventional outfit, you might say, "Hey, if you like it, you do you!" 💥"The credits roll, but the story lingers." ⚜This phrase suggests that even after an event has concluded (like a movie ending with credits), the impact or essence of the experience continues to resonate or affect people. It implies that stories, emotions, or lessons learned endure beyond their immediate context. ⚡️ After finishing a powerful film, you might reflect, "The credits roll, but the story lingers in my mind long after."