Results for “console”

Showing 1–10 of 17

  1. 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.

    Write the code Hard 2 stages project lists stack append
  2. Challenge

    Progress on one line

    …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…

    Write the code Easy 3 stages print end progress console
  3. Challenge

    Validate a command

    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.

    Write the code Easy 2 stages if elif else input
  4. Challenge

    Command parser

    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…

    Write the code Medium 2 stages project parsing strings split
  5. Challenge

    Normalise a command

    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…

    Write the code Easy 3 stages strings strip lower replace
  6. Challenge

    Logging instead of print

    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…

    Fix the code Medium 2 stages logging debug info warning
  7. Challenge

    Alert level

    …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…

    Write the code Easy 2 stages if elif else comparisons
  8. Challenge

    Status message crash

    …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…

    Fix the code Easy 3 stages TypeError str type conversion debugging
  9. Challenge

    Read the traceback

    …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…

    Fix the code Easy 2 stages errors traceback KeyError TypeError