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

Резултати

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

Пребарај: #landscapes

当前筛选 #landscapes清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #452 · 28.07.2025 г., 22:22

🌎 Deep in southeastern Iran, the mysterious Kaluts desert features gigantic, wind-carved sand formations called “yardangs.” These natural sculptures stretch for kilometers, shaped by centuries of relentless wind erosion. ✨ #geology⚡#desert⚡#landscapes 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #591 · 19.08.2025 г., 20:22

🌎 Powerful enough to move mountains, glaciers shaped entire continents. As they advanced, their slow, grinding ice carved out valleys, lakes, and fjords still visible today. ✨ #geology⚡#glaciers⚡#landscapes 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #829 · 28.09.2025 г., 20:11

🌎 Southern China’s Stone Forest, or Shilin, is a dramatic landscape of towering limestone pillars shaped by both natural erosion and centuries of quarrying. Human mining over the last thousand years has altered parts of this ancient karst region, creating new rock formations and open spaces alongside original spires. ✨ #geology⚡#humanimpact⚡#landscapes 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #254 · 17.09.2025 г., 16:12

🌍 The Rice Terraces of Yuanyang in China were carved into steep mountains over centuries. These living heritage sites are so vast they create their own microclimate and reflect the region's cultural history. ✨ #heritage⚡#landscapes⚡#agriculture⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #50 · 15.08.2025 г., 00:12

🌍 The geographic shell of the Earth includes plateaus, plains, and mountain ranges, creating a patchwork that determines where rivers flow and where different climates form. ✨ #landforms⚡#climate⚡#landscapes⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #690 · 14.04.2026 г., 20:31

🌍 In Japan, centuries-old forest areas called satoyama are shaped by human care for farming, wood, and water, blending wild nature and villages into landscapes rich in biodiversity and tradition. ✨ #interaction⚡#landscapes⚡#biodiversity⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #468 · 21.11.2025 г., 20:31

🌍 Some arid desert landscapes feature ancient, dried-up riverbeds called wadis that can flood suddenly after rare rains, quickly turning from bare channels to rushing streams in a matter of hours. ✨ #desert⚡#arid⚡#landscapes⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #385 · 17.10.2025 г., 20:31

🌍 In Indonesia, ancient forests and rice terraces share land with villages, blending wild and human-shaped environments. This mix supports rare wildlife while feeding local communities. ✨ #interaction⚡#landscapes⚡#sustainability⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #484 · 29.11.2025 г., 20:31

🌍 In China's southern hills, vast terraces transform mountains into rice fields. These hand-carved steps let farmers grow crops high above valleys, creating some of the world’s most scenic farmland. ✨ #agriculture⚡#landscapes⚡#rice⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #636 · 16.02.2026 г., 20:31

🌍 Italy’s Cinque Terre is a World Heritage Site where human-built terraced vineyards cling to steep cliffs beside the sea. Centuries of farming have shaped this landscape into a living cultural mosaic. ✨ #heritage⚡#landscapes⚡#vineyards⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #181 · 05.09.2025 г., 13:12

🌍 England’s Lake District is a UNESCO World Heritage Site where centuries of sheep farming shaped rolling hills and stone walls, blending natural scenery with a rich cultural landscape. ✨ #heritage⚡#landscapes⚡#UNESCO⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

12
ПретходнаСтраница 1 од 2Следна