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

Резултати

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

Пребарај: #newindia

当前筛选 #newindia清除筛选
MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13379 · 14.04.2025 г., 06:44

From Runways to Sky-High Stats ✈️ India’s passenger traffic soars 143% — a testament to rising infrastructure, connectivity & progress! #NewIndia

Hashtags

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #12790 · 05.06.2023 г., 13:02

Exciting opportunity to test your knowledge and contribute to nation-building 📝🧾 Take part in the '9 Years of Seva, Sushasan aur Garib Kalyan' Mahaquiz 2023 and celebrate the progress made towards #NewIndia. Visit: https://quiz.mygov.in/quiz/9-years-seva-sushasan-aur-garib-kalyan-mahaquiz-2023/

Hashtags

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #12691 · 10.05.2023 г., 08:52

Modern stations for a modern India! With state-of-the-art facilities & world-class amenities, the upgraded railway stations will be a reflection of #NewIndia's progress

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #12283 · 09.03.2023 г., 07:09

Capture the transformation of #NewIndia with your lens! Participate in contest and get a chance to win exciting cash prizes Visit: https://innovateindia.mygov.in/beneficiary-videos/

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #12181 · 27.02.2023 г., 11:14

Show #NewIndia with your lens! Participate in "Inviting Videos of Transformative Impact" and highlight the benefits received from particular schemes Visit: https://innovateindia.mygov.in/beneficiary-videos/

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #12143 · 23.02.2023 г., 15:11

Calling all creative minds to compose a Jingle for the 100th episode of Mann Ki Baat Participate & get a chance to make your jingle remain in the minds and hearts of #NewIndia Visit: https://secure.mygov.in/task/compose-jingle-100th-episode-mann-ki-baat/

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #12142 · 23.02.2023 г., 14:10

Show #NewIndia with your lens! Participate in "Inviting Videos of Transformative Impact" and highlight the benefits received from particular schemes Visit: https://innovateindia.mygov.in/beneficiary-videos/

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #12118 · 20.02.2023 г., 09:09

Here's a platform to showcase the #NewIndia Share your Before and After videos and describe how a particular scheme of government has benefited you Visit: https://innovateindia.mygov.in/beneficiary-videos/

Hashtags

MyGov Newsdesk

@mygovcoronanewsdesk · Post #11479 · 29.11.2022 г., 08:10

Are you the next best-selling author of #NewIndia? We are looking for you! Apply for YUVA 2.0 and get mentorship, stipend and much more! Know more here : innovateindia.mygov.in/yuva/

Hashtags

123•••10•••20•••2526
ПретходнаСтраница 1 од 26Следна