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…
Showing 21–30 of 32
Challenge
…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…
Challenge
…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()…
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
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…
Challenge
…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…
Challenge
…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…
Challenge
…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.
Challenge
…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…