Results for “units”

Showing 11–18 of 18

  1. Challenge

    Telemetry from CSV

    …you loop, keep the hottest reading in degrees Celsius, unit C , in hottest , and print it after the readings: Hottest: ENG-1 455.2 C at 09:30:15 Compare float(row["value"]) , not the text: as strings…

    Write the code Medium 2 stages csv csv.DictReader files open
  2. Challenge

    Test the parser

    …{"time": "09:30:05", "sensor": "ENG-2", "value": 412.5, "unit": "C"} . Leave the function as it is. Lines that aren't readings Add checks for the lines the parser must turn into None : an empty line…

    Write the code Medium 2 stages testing assert parsing None
  3. Challenge

    Parse the whole feed

    …at the commas, and print the sensor, the value and the unit: ENG-2: 412.5 C TANK-1: 78.3 % CABIN: 101.2 kPa ENG-2: 415.0 C feed.splitlines() gives a list with one string per line. Inside the loop…

    Write the code Easy 2 stages for loop splitlines split unpacking
  4. Challenge

    Telemetry report

    …on one row: the time of day, the sensor, the value and the unit. 09:30:05 ENG-2 412.5 C 09:30:06 CAB-1 101.3 kPa 09:30:07 BAT-3 87.2 % feed.split("\n") splits the feed into its lines, and each line…

    Write the code Medium 2 stages strings split slicing f-strings
  5. 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
  6. 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
  7. 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
  8. Challenge

    Test the pipeline

    The telemetry pipeline is now split into parse_row() and check_limits(). Write assert tests for both, good rows, rejected rows and readings right at a limit, so that each of three planted bugs makes…

    Write the code Hard 2 stages project testing assert try