Challenge
Undo and history
Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.
Showing 1–10 of 17
Challenge
Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.
Challenge
…ground station uploads a flight plan to Python One , the console first shows what it's doing and then, once it's finished, how it went. Command-line tools do this all the time: you see Uploading…
Challenge
Read a console command with input(), accept start, stop and status in any case with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.
Example
…function is the basic tool for displaying data in Python console.
Challenge
Operators type commands into the console in a hurry, with stray spaces, capital letters and the occasional slip of the finger. The flight software must never act on a command it didn't fully…
Challenge
Operators type commands into Python One 's console in their own way: spaces before and after, capital letters, Launch , LAUNCH or launch . The command parser has to understand them all. Clean up what…
Challenge
The tank check is full of prints left over from debugging. Replace them with logging calls at the right levels, so debug records stay hidden until switched on, then give the fuel code its own named…
Challenge
…level with two thresholds, then build the status line the console shows. Three levels Print OK , WARN or CRITICAL for the temperature. From 400 °C it's WARN, from 450 °C CRITICAL, anything lower is…
Challenge
…and the altitude with + , and instead of a status, the console shows an error. Predict what happens, see the crash, find out why, fix it without changing the message, then write a status line of your…
Challenge
…exactly where it points. Bottom up Run the program. In the console, Python prints the traceback: File "script.py", line 20 File "script.py", line 16, in average_kelvin File "script.py", line 10, in…