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

Резултати

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

Пребарај: #mgimo81

当前筛选 #mgimo81清除筛选

🌐 Today marks the 81st anniversary of the founding of the Moscow State Institute of International Relations!Congratulations to all – alumni, students, professors, and friends of the university – on the birthday of their beloved alma mater! 📜Historical background: 81 years ago, on October 14, 1944, the People’s Commissariat for Foreign Affairs of the USSR, headed by Vyacheslav Molotov, decided to establish a specialized educational institution for diplomatic training. In the final years of the Great Patriotic War, it became clear that the Soviet Union needed a new generation of professionals for its foreign service. The growing number of international contacts and negotiations on the post-war world order required highly qualified experts fluent in foreign languages, as well as in history, law, and economics. Such specialists were also needed for work in international organizations that were being planned after the war – above all, the United Nations and its affiliated bodies. 🌍In 1946, #MGIMO opened its doors to foreign students, laying the foundation for its international academic reputation. Since then, it has become one of Russia’s most international universities: today, students from more than 90 countries study here, and foreigners make up about 16% of the total student community. In 2025 alone, 400 students from 55 countries enrolled in the freshmen year. Last year, Russia’s leading university specializing in international relations celebrated its 80th Anniversary – 👉#Recap. Over the decades of its active and fruitful work, MGIMO has rightfully earned its reputation as a world-class university – a genuine “foundry” of diplomats, journalists, and even presidents. 💬President of the Russian Federation Vladimir Putin: MGIMO has firmly established itself among the world’s leading centers for the training of international specialists. For many decades, its graduates have formed the professional “backbone” of Russia’s diplomatic service. Genuine professionalism also distinguishes MGIMO alumni working in other areas – in government agencies, academia, education, business, and the media. It is no coincidence that a MGIMO diploma is highly valued not only in Russia, but also abroad. 💬Foreign Minister of the Russian Federation Sergey Lavrov (MGIMO, Class of 1972): Diplomacy is the art of negotiation. The formation of a multipolar world is a long process that may take an entire historical era. MGIMO graduates will definitely have enough work to do. ✊We wish #MGIMO enduring prosperity, inspiration, and countless new triumphs! May the university always remain a place where the spirit of knowledge, friendship, and aspiration reigns – where every new generation of students feels pride in their alma mater, finds support, loyal friends, and their true calling! #MGIMO81