Results for “errors”

Showing 21–30 of 32

  1. Challenge

    Config loader

    …is not valid JSON is one problem, not valid JSON: and the error's msg ; JSON that is not an object, such as a list, is one problem too. In both cases the config is a copy of the defaults. Only…

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

    Counter

    …counts[level] += 1 . The output stays as it was: DEBUG: 2 ERROR: 1 INFO: 4 WARN: 3 Most common first Replace the sorted listing with one from the most common level down, using counts.most_common()…

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  3. Challenge

    Extra log fields

    …passed: [T+00:12:05] INFO Engines nominal [T+00:14:47] ERROR Fuel valve 2 not responding valve=2 pressure_kpa=310 Add **fields after msg . Inside, fields is a dict: build the line, then loop over…

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

    Log formatter function

    …The function is now used for a whole orbit's entries, and ERROR is five letters long, so its messages start one column later than the others. Change only the function so the level is padded to five…

    Fix the code Easy 2 stages functions def return refactoring
  5. 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
  6. Challenge

    Command parser

    Write parse_command(), which turns typed commands such as burn 12.5 or set mode safe into tuples and raises ValueError with a reason for anything malformed, then run a whole batch of commands and…

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

    Broken boot script

    …Run the boot script. Instead of booting, it stops with an error: one line is missing its closing quote. Fix it so the script prints: Booting flight computer... Loading navigation data... Boot complete…

    Fix the code Easy 3 stages SyntaxError debugging print quotes
  8. Challenge

    Missing field

    …Instead of a board with one blank, the operators got an error and no board at all. Predict what happens, find out what the dict really holds, fix it, then build a board that copes with any missing…

    Fix the code Easy 3 stages dictionaries KeyError get default values
  9. Challenge

    Count warnings

    …line with one line per level: Entries: 7 INFO: 4 WARN: 3 ERROR: 0 Use the same pattern for each: "] INFO" , "] WARN" and "] ERROR" . A level that never appears counts as 0.

    Write the code Medium 3 stages strings count multi-line strings logs
  10. Challenge

    Telemetry pipeline

    …together: the CSV reader from "Telemetry from CSV", the error handling from "Survive bad lines", the limits from the alert checks and the JSON from "JSON out". The ground station's export arrives…

    Write the code Hard 3 stages project csv json files