Results for “continue”

10 results

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

    Write the code Medium 2 stages for loop continue strip startswith
  2. Challenge

    Survive bad lines

    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…

    Write the code Medium 2 stages errors try except ValueError
  3. Challenge

    Telemetry pipeline

    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…

    Write the code Hard 3 stages project csv json files
  4. Challenge

    Parser function

    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.

    Fix the code Medium 2 stages functions return dictionaries None
  5. Challenge

    Line to record

    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.

    Write the code Easy 2 stages dictionaries lists parsing records
  6. Challenge

    Unit converter

    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…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  7. 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
  8. Challenge

    Duplicate events

    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.

    Write the code Medium 2 stages sets add in deduplication
  9. Challenge

    Safe number input

    …the try around the conversion only. Inside except , use continue to go straight to the next question; after the try , check the number.

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

    Running totals

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

    Write the code Easy 3 stages variables -= += updating values