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

Резултати

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

Пребарај: #africacupofnations

当前筛选 #africacupofnations清除筛选
AI match predictions

@ai_match_prediction · Post #11211 · 29.03.2026 г., 05:05

Africa Cup of Nations - Qualification🌍 2026-03-29 13:00 UTC South Sudan vs. Djibouti Predicted outcome: South Sudan❌ Predicted score: 4:0 Actual: Djibouti 0:1 #SouthSudan#Djibouti 2026-03-29 15:00 UTC Lesotho vs. Seychelles Predicted outcome: Draw❌ Predicted score: 0:0 Actual: Lesotho 2:1 #Lesotho#Seychelles #Football#AfricaCupofNations

AI match predictions

@ai_match_prediction · Post #11186 · 26.03.2026 г., 09:05

Africa Cup of Nations - Qualification🌍 2026-03-26 13:00 UTC Djibouti vs. South Sudan Predicted outcome: South Sudan✅ Predicted score: 1:3 Actual: South Sudan 0:4 #Djibouti#SouthSudan 2026-03-26 14:00 UTC Seychelles vs. Lesotho Predicted outcome: Lesotho❌ Predicted score: 0:2 Actual: Draw 0:0 #Seychelles#Lesotho #Football#AfricaCupofNations

AI match predictions

@ai_match_prediction · Post #11195 · 27.03.2026 г., 05:05

Africa Cup of Nations - Qualification🌍 2026-03-27 13:00 UTC Somalia vs. Mauritius Predicted outcome: Mauritius❌ Predicted score: 0:1 Actual: Draw 0:0 #Somalia#Mauritius 2026-03-27 13:00 UTC Chad vs. Burundi Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Burundi 0:4 #Chad#Burundi 2026-03-27 16:00 UTC Sao Tome and Principe vs. Ethiopia Predicted outcome: Ethiopia✅ Predicted score: 1:2 Actual: Ethiopia 0:3 #SaoTomeandPrincipe#Ethiopia #Football#AfricaCupofNations

AI match predictions

@ai_match_prediction · Post #11226 · 31.03.2026 г., 05:05

Africa Cup of Nations - Qualification🌍 2026-03-31 13:00 UTC Ethiopia vs. Sao Tome and Principe Predicted outcome: Ethiopia✅ Predicted score: 3:1 Actual: Ethiopia 1:0 #Ethiopia#SaoTomeandPrincipe 2026-03-31 13:00 UTC Burundi vs. Chad Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Burundi 4:0 #Burundi#Chad 2026-03-31 14:00 UTC Eswatini vs. Eritrea Predicted outcome: Eswatini❌ Predicted score: 2:1 Actual: Eritrea 1:2 #Eswatini#Eritrea 2026-03-31 15:00 UTC Mauritius vs. Somalia Predicted outcome: Somalia❌ Predicted score: 0:1 Actual: Draw 0:0 #Mauritius#Somalia #Football#AfricaCupofNations