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

Резултати

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

Пребарај: #carlaunch

当前筛选 #carlaunch清除筛选
Auto Life

@revheadcrypto · Post #378 · 23.08.2024 г., 22:34

🚗✨ Exciting news! The updated Volvo XC90 is set to be unveiled on September 4th! 🌟 🔋 This refreshed model will feature a hybrid powertrain, ensuring it remains relevant until the brand transitions fully to electric vehicles by the end of the decade. ⚡️ Stay tuned for more updates! #VolvoXC90#HybridPower#SustainableDriving#CarLaunch#Auto

Auto Life

@revheadcrypto · Post #212 · 01.08.2024 г., 07:42

🚗Exciting news for BMW fans! The new BMW M5 Touring will be unveiled on August 15 at Pebble Beach. This innovative model will hit the US market in spring 2025, marking the first official M5 Touring available in the country. Stay tuned for more updates! #BMW#M5Touring#PebbleBeach#CarLaunch#Auto

Auto Life

@revheadcrypto · Post #294 · 10.08.2024 г., 07:44

🚗✨Introducing the Updated Kia K8 Sedan!🇰🇷 The all-new K8 features a completely redesigned front and a simplified interior architecture, enhancing both style and comfort. The rear has also been refreshed with the removal of fake exhaust tips. 🔥 Under the hood, South Korean buyers can choose from: - 🛢️2.5L and 3.5L gasoline engines (198 or 300 hp) - 🌱Hybrid powertrain based on a 1.6L engine delivering 230 hp - 🔄 The 3.5L engine also offers a bi-fuel version with 240 hp and optional all-wheel drive! 💰 Starting price: 37.36 million won ( $27,000). #KiaK8#Sedan#CarLaunch#KiaMotors#AutomotiveInnovation#LuxuryCars#Auto🚘🌟

Auto Life

@revheadcrypto · Post #379 · 24.08.2024 г., 17:26

🚗✨ Skoda Unveils the "Kulaak" in India! 🇮🇳 Introducing the new Kylaq crossover, measuring under 4 meters, set to hit the market in 2025! The name was chosen through a public vote and translates to "crystal" from Sanskrit. 💎 🔧 Engine Specs: - 🏎️ 1.0 TSI engine with 115 hp - 🔄 Available with a manual or automatic transmission - 🚙 Front-wheel drive only #SkodaKylaq#Crossover#CarLaunch#India#Innovation#Skoda#Automotive#Auto

Auto Life

@revheadcrypto · Post #545 · 02.10.2024 г., 09:34

🚘✨Introducing the Skoda Elroq Electric Crossover!✨🚘 The new Skoda Elroq is slightly larger than the Karoq, measuring 4488x1884x1625 mm with a wheelbase of 2765 mm. With a ground clearance of 186 mm, it’s ready for any adventure! 🌍💪 ⚡️Performance Features: - Available with electric motors producing 170, 204, or 286 hp. - The top all-wheel-drive version boasts an impressive 299 hp! 🚀 - Range: From 375 to 560 km on a single charge! 🔋🌿 ✅Simply Clever Innovations: - Tire tread depth gauge integrated into the ice scraper! ❄️ - Elastic net under the luggage shelf for convenient charging cable storage! 📦🔌 ℹ️ The petrol Karoq starts at €33,100 in Germany, while the Elroq will be just €760 more! 💰🇩🇪 #SkodaElroq#ElectricCrossover#SimplyClever#SustainableDriving#CarLaunch#Auto#Innovation#Skoda

Auto Life

@revheadcrypto · Post #213 · 01.08.2024 г., 07:59

Audi has officially unveiled the new generation A6! Now, this index belongs to electric vehicles — a liftback and an estate version. 🚘 The exterior of the new models is almost entirely copied from the namesake concepts, while the interior is inspired by the Q6 e-tron crossover. 🚢 The base version will be the rear-wheel drive A6 e-tron performance with a single motor producing 367 hp. For the S6, there will be two motors delivering 550 hp and accelerating from 0 to 100 km/h in just 3.9 seconds, with a top speed of 240 km/h. 🔋 In both cases, a 100 kWh battery is provided, allowing the single-motor versions to travel up to 756 km, while the all-wheel drive versions can reach up to 675 km. ℹ️ Pre-orders will start in September, with prices starting at €75,600 for the standard version and €99,500 for the S6. #Audi#A6#ElectricVehicles#ETRON#CarLaunch#LuxuryCars#Innovation#S6#Auto