Challenge
Skip blanks and comments
Extend the feed parser so continue skips blank lines and comment lines, then report damaged lines with too few fields instead of crashing, with a count of parsed and damaged lines.
10 results
Challenge
Extend the feed parser so continue skips blank lines and comment lines, then report damaged lines with too few fields instead of crashing, with a count of parsed and damaged lines.
Challenge
Extend the feed parser from "Skip blanks and comments": a faulty sensor sends ERR and float() stops the program. Skip lines that fail to convert and count them, then let one try cover short lines too…
Challenge
A small but complete data pipeline: read the telemetry CSV, reject rows with unknown sensors or broken values and say why, flag readings outside each sensor's limits, and save a JSON summary for the…
Challenge
Move the feed parser from "Line to record" into parse_line(line), which returns the record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
Extend the feed parser so it stores every reading as a dict with time, sensor, value and unit in a list of records, then let other code pick out one sensor's readings by key.
Challenge
Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…
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
Print each capsule event once, keeping the first copy, by checking every ID against a set of IDs already seen, then report which IDs came in more than once.
Challenge
…the try around the conversion only. Inside except , use continue to go straight to the next question; after the try , check the number.
Challenge
…burn_1 and store the number in after_first_burn . Modify. Continue the sequence: the second burn, the top-up and the third burn, each with -= or += , printing the level after each step: After burn 1…