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

Резултати

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

Пребарај: #bennu

当前筛选 #bennu清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #25 · 30.07.2025 г., 01:00

🪐 In the constellation Ophiuchus, the asteroid 101955 Bennu harbors boulders on its surface that are actually fragments from a much larger parent asteroid, dislodged by ancient cosmic impacts. Analysis of samples returned by NASA’s OSIRIS-REx mission revealed minerals that interacted with liquid water billions of years ago, revealing Bennu as a time capsule from the dawn of the solar system. ✨ #Bennu⚡#asteroids⚡#OSIRISRex 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #338 · 27.09.2025 г., 18:21

🪐 One of the most intriguing potentially hazardous asteroids is (101955) Bennu, a 500-meter-wide space rock that approaches Earth every six years. Bennu's orbit is so well-studied that NASA sent the OSIRIS-REx mission to collect samples, as even small forces—like sunlight changing its spin—can alter its path, making Bennu a prime real-world example of why scientists keep a close watch on these cosmic wanderers. ✨ #asteroids⚡#hazard⚡#Bennu⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #290 · 18.09.2025 г., 09:40

🪐A skyscraper-sized space rock is on its way past Earth. On September 18, 2025, asteroid 2025 FA22, measuring up to 300 meters across, will sweep by our planet. At its closest, it will be about 835,000 km away — more than twice the distance to the Moon. Moving at a breathtaking 34,000 km/h, this Apollo-type asteroid silently follows its orbit around the Sun, crossing Earth’s path in space. The flyby will peak around 07:41 UTC, a moment astronomers worldwide are watching closely. Massive, fast, and ancient — yet passing safely by. Encounters like this remind us how close cosmic giants can come, while still leaving Earth untouched. ✨ #asteroids⚡#hazard⚡#Bennu⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #231 · 06.09.2025 г., 13:11

🪐 The asteroid Bennu, about 500 meters wide, orbits the Sun and regularly passes close to Earth—so close that it’s classified as a “potentially hazardous asteroid.” Scientists continually monitor Bennu’s path because even small shifts caused by sunlight (known as the Yarkovsky effect) could alter its future trajectory, making it one of the most closely watched objects to help protect our planet from possible impacts. ✨ #asteroid⚡#hazards⚡#Bennu⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #432 · 16.10.2025 г., 15:21

🪐 One of the closest ongoing space threats to Earth is asteroid (101955) Bennu, a 500-meter-wide rock whose orbit brings it near our planet about every six years. Bennu's path is carefully tracked because even small gravitational nudges or sunlight (the Yarkovsky effect, where heat causes tiny pushes) could change its future route, making it a real-world example of why scientists keep a vigilant watch on these near-Earth objects. ✨ #asteroids⚡#defense⚡#Bennu⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​