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

Резултати

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

Пребарај: #rings

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

@cosmomyst · Post #12 · 29.07.2025 г., 18:51

🪐 Hidden deep inside Saturn’s rings, astronomers have discovered tiny moonlets like Daphnis that carve out delicate waves and gaps as they orbit, sculpting the rings’ sharp edges. These miniature moons cause astonishing ripples and wakes, their gravitational dance leaving patterns that shift with every pass. ✨ #Saturn⚡#moonlets⚡#rings 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #749 · 22.04.2026 г., 22:21

🪐 The galaxy Arp 147 shows off one of the universe’s strangest shapes—a bright blue ring of young stars wrapped around a reddish core, formed after a dramatic collision with another galaxy. This kind of "ring galaxy" is extremely rare, created when one galaxy punches through another, sending waves through the gas and sparking new stars to ignite in a perfect circle, making Arp 147 a cosmic example of how galactic crashes can sculpt extraordinary structures. ✨ #galaxies⚡#collisions⚡#rings⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #501 · 16.11.2025 г., 12:21

🪐 The galaxy NGC 922, located about 157 million light-years away in the constellation Fornax, sports a dramatic ring-shaped structure that formed after it collided with a smaller galaxy. This "collisional ring galaxy" features a bright, blue ring of new stars encircling its core, revealing the powerful effects of galactic crashes and creating a cosmic shape rarely found in the universe. ✨ #galaxies⚡#rings⚡#collisions⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #687 · 18.02.2026 г., 12:21

🪐 The galaxy Hoag's Object, located about 600 million light-years away in the constellation Serpens, is a stunning example of a ring galaxy—a nearly perfect circle of bright blue stars surrounding a yellow core. This puzzling shape is believed to have formed when another galaxy passed through Hoag's Object, disrupting its stars and creating the iconic cosmic ring, a form almost never seen among the billions of known galaxies. ✨ #galaxies⚡#serpens⚡#rings⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #603 · 05.01.2026 г., 12:21

🪐 Saturn’s rings are made mostly of icy particles ranging from the size of grains of sand to mountains, but what’s remarkable is that these rings are incredibly thin—often only about 10 meters thick compared to their width of up to 282,000 kilometers. Despite their vast size, the rings would still fit comfortably within the gap between Earth and the top of our atmosphere if laid flat. ✨ #Saturn⚡#rings⚡#giants⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #103 · 09.08.2025 г., 00:11

🪐 The giant planet Saturn is the only world in our solar system with rings visible from Earth through even a small telescope, but Saturn is not alone—Jupiter, Uranus, and Neptune each have their own faint and delicate ring systems. Unlike Saturn’s bright icy rings, the rings around Jupiter, Uranus, and Neptune are darker and mostly made of dust, making them nearly invisible except with powerful spacecraft or specialized equipment. ✨ #Saturn⚡#rings⚡#Uranus⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #236 · 07.09.2025 г., 13:11

🪐 The giant planet Saturn is so light for its size that if you could find a big enough pool of water, it would float—its average density is less than water’s! Saturn's stunning ring system, made mostly of chunks of ice and rock, stretches out more than 280,000 kilometers from the planet, dwarfing the distances between many of its moons. ✨ #Saturn⚡#rings⚡#density⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​