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 слични објави

Пребарај: #drivingexperience

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

@revheadcrypto · Post #23 · 01.07.2024 г., 14:59

🔥✨Unleash the Power of Aston Martin Valiant!✨🔥 Embark on a journey of power and precision with the Aston Martin Valiant, driven by a formidable 5.2-liter V12 engine with twin turbocharging, delivering an impressive 745 horsepower (compared to 715 in the Valour). Feel the exhilarating torque of 753 Nm propelling you forward with each twist of the throttle. Get ready to ignite your senses! This fusion of power and performance is harnessed by an exclusive six-speed manual transmission, seamlessly transferring power to the rear wheels, creating an unmatched driving experience. Trust the Aston Martin Valiant to experience the exceptional blend of technology and emotion on the road. Dive into the true embodiment of power, style, and automotive mastery with the Aston Martin Valiant! #AstonMartin#Valiant#V12Power#Performance#DrivingExperience

Auto Life

@revheadcrypto · Post #561 · 09.10.2024 г., 08:59

🚗✨Lexus Unveils Upgraded LC Coupe and Convertible!✨🚗 Since its debut in 2017, the Lexus LC family has received a sleek exterior makeover and new interior materials. But that's not all! The updated models now feature a stiffer chassis, thanks to additional braces installed under the floor near the front and rear axles, enhancing overall handling. 🏎️💨 Under the hood, the Lexus LC offers a powerful lineup: a 5.0L V8 engine producing 477 hp or a hybrid V6 powertrain with a 3.5L engine delivering 359 hp. 🔥🔋 #LexusLC#LuxuryCars#CarEnthusiast#DrivingExperience#AutoNews#V8Power#Auto

Auto Life

@revheadcrypto · Post #368 · 21.08.2024 г., 18:08

🚗✨ Updated Audi RS 3: Hatchback and Sedan Debut! ✨🚗 🔧 The facelift brings a fresh look with new headlights featuring a checkered flag design for the daytime running lights, which can be customized! 🏁 🛠️ Inside, you’ll find a revamped steering wheel that’s now flat on both the top and bottom, complete with two new red buttons to activate RS Performance and RS Individual modes! 🔴🔵 Optional carbon bucket seats offer enhanced support for those thrilling drives. 🪑💨 💥 The Audi RS 3 retains its powerful 2.5-liter turbocharged five-cylinder engine, delivering 400 hp and 500 Nm of torque, paired with a seven-speed dual-clutch transmission and all-wheel drive. ⚡️💪 It still rockets from 0 to 100 km/h in just 3.8 seconds, with a top speed of 290 km/h! 🚀 🔄 Engineers have fine-tuned the torque splitter algorithm (RS Torque Splitter) and optimized chassis settings, allowing drivers to tackle corners at higher speeds! 🏎️💨 #AudiRS3#Performance#CarEnthusiast#TurboPower#LuxuryCars#DrivingExperience#Innovation#Auto🚘💖

Auto Life

@revheadcrypto · Post #433 · 04.09.2024 г., 16:41

🚗✨ Introducing the new Aston Martin Vanquish with a powerful V12! 🌟 🔧 Equipped with a twin-turbo engine delivering an impressive 835 hp and 1000 Nm of torque (just edging out the Ferrari 12Cilindri at 830 hp)! 💪 ⚡️ Accelerating from 0 to 60 mph (96 km/h) in just 3.2 seconds, this flagship beauty boasts a top speed of 344 km/h! 🏁 🛠️ The Vanquish features a brand new body with a 75% increase in stiffness compared to the DBS. It comes with carbon-ceramic brakes and cutting-edge Bilstein DTX adaptive dampers for an unparalleled driving experience! 🚀 📅 Deliveries of this grand tourer will begin in Q4, with a starting price of $420,000. 💰 #AstonMartin#Vanquish#V12#LuxuryCars#Performance#CarEnthusiasts#Supercar#DrivingExperience#Auto