-
Should Software Decay And Lose Data?
Hello, checkiomates🐱👤!
Welcome back, it's our new digest. Try out new simple mission to warm up, take a quiz about string representation of output, think about software that should lose data and consider adding keyboard shortcuts to your REPL with Python 3.13!
💡TIP
At every mission page, under the editor window, there is a terminal window. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
🏁MISSION
Autopilot by freeman_lex -
A large electric car factory is making improvements to its autopilot system and needs your help to implement a program that decides whether car B, which is driving in the middle of two cars A and C, needs to accelerate, decelerate or maintain its current speed. Car B needs to be accelerated if the distance from its rear to the rear of car A is less than the distance from its rear to the rear of car C.
speed_adjust(0, 2, 6) == 1 speed_adjust(0, 4, 6) == -1 speed_adjust(0, 3, 6) == 0
📖ARTICLES
Make It Ephemeral: Software Should Decay and Lose Data -
Most software that exists today does not forget. Creating software that remembers is easy, but designing software that deliberately “forgets” is a bit more complex. This ability to forget can be an incredibly benefitial property for many applications. Most importantly software that forgets enables different user experiences.
Adding keyboard shortcuts to the Python REPL -
The author likes to share a secret feature within the Python 3.13 REPL which I’ve been finding useful recently: adding custom keyboard shortcuts. This feature involves a PYTHONSTARTUP file, use of an unsupported Python module, and dynamically evaluating code. In short, we may be getting ourselves into trouble. But the result is very neat!
Using .__repr__() vs .__str__() in Python Quiz -
In this quiz, you’ll test your understanding of Python’s .__repr__() and .__str__() special methods. These methods allow you to control how a program displays an object, making your classes more readable and easier to debug and maintain.
👩💻CODE SHOT
How do you think, what the following code does?
def ??????????(moves: str) -> int: t, f, r = 1, 2, 3 for move in moves: t, f, r = {"N": f, "S": 7 - f, "W": r, "E": 7 - r}.get(move),\ {"N": 7 - t, "S": t}.get(move, f),\ {"W": 7 - t, "E": t}.get(move, r) return t
🙌 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! ⤵
Welcome to CheckiO - games for coders where you can improve your codings skills.
The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.
Join the Game