Results for “error messages”

Showing 11–17 of 17

  1. Challenge

    Safe number input

    …try , break when it works, and except ValueError: for the message. The check doesn't show the question itself, only what the program prints. Only positive lengths A burn of 0 or -5 seconds converts…

    Write the code Easy 2 stages errors try except ValueError
  2. Challenge

    Validate a command

    …are typed, reject everything else clearly, then make the error messages helpful. Three commands Ask for a command with input() . Accept start , stop and status in any case and with spaces around them…

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

    Config loader

    …saved setting, in the order it was saved, and collect a message for each problem: an unknown name, a number setting that is not a number or is outside its range in RANGES , a safe_mode that is not…

    Write the code Hard 3 stages project json configuration validation
  4. Challenge

    Extra log fields

    A bare log message often isn't enough to diagnose a problem: which valve, at what pressure, on which orbit? Every subsystem wants to attach different details, and nobody wants a format_log() with…

    Write the code Medium 2 stages functions **kwargs keyword arguments dictionaries
  5. Challenge

    Command parser

    …own ValueError : catch it and raise yours, with a clearer message. set mode and abort Two more commands: set mode X , where X is one of MODES , returns ("set", "mode", X) , and abort , with no values…

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

    Log line format

    …tools filter them by level, and alarms go off when an ERROR line appears. That only works if every line has exactly the same shape: [T+00:12:05] INFO Engines nominal The time since launch in square…

    Write the code Easy 2 stages f-strings print logs formatting