Hello, checkiomates🐱👤!
This week's digest elevates your Python skills. We explore professional feature flags, master hidden networking powers, and hone our workflow with advanced REPL features. The mission challenges you to apply logic to a hotel's pricing promotion.
💡TIP
If you find an interesting solution, you may add it to your bookmarks by clicking the flag near solution title. You can find all your bookmarked solutions by clicking your nickname and then "Bookmarks". If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
🏁 MISSION
Hotel Hosting Costs by freeman_lex -
The hotel has a promotion for the July vacations. The promotion is valid for those who arrive from July 1st and leave on August 1st. The price of the hotel rate is lower for those who arrive earlier, and increases every day. Given the day of arrival (1 ≤ day ≤ 31), the initial rate and the daily increase rate, calculate the total amount to be paid by a customer who arrives on that day.
hotel_cost(100, 10, 1) == 3100 hotel_cost(100, 20, 15) == 6460 hotel_cost(100, 5, 16) == 2720
📖 ARTICLES
Feature flags are a way for us to enable or disable code paths without needing to re-deploy software. This post shows you several different approaches to feature flags.
Master IPs, Networks, and Subnets Efficiently -
Python’s built-in ipaddress module makes handling IP addresses and networks clean and reliable. This article shows how to validate, iterate, and manage addresses and subnets while avoiding common pitfalls of string-based handling.
Python REPL Shortcuts & Features -
Python 3.13 introduced a completely redesigned REPL with a much more modern feel. It's easy to overlook many of the features in the new Python REPL. Let's explore the various hidden features the new Python REPL supports, with a focus on tips that are useful for everyday usage.
👩💻CODE SHOT
What do you think the following code does?
def checkio(items: list[int]) -> list[int]:
return sorted(items, key=lambda n: list(map(str(n).count, '9876543210')) + [n])
🙌 Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ⤵
