Results for “timestamp”

Showing 11–16 of 16

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

    Test the parser

    Write assert checks for parse_line() from "Parser function": the whole record for a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't…

    Write the code Medium 2 stages testing assert parsing None
  3. 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
  4. Challenge

    Legacy script

    A 70-line engine report repeats the same twelve lines for each engine. Restructure it into parse_feed() and summary_line() with the output unchanged to the character, then add assert tests that would…

    Fix the code Hard 2 stages project refactoring functions testing
  5. Challenge

    Parse the whole feed

    …line", and start each line with the clock time from the timestamp: 09:30:05 ENG-2: 412.5 C 09:30:05 TANK-1: 78.3 % 09:30:10 CABIN: 101.2 kPa 09:30:10 ENG-2: 415.0 C timestamp, sensor, value, unit =…

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

    Telemetry report

    …at the commas as before. The time of day is [11:19] of the timestamp. print() puts a space between its values. Aligned columns Now make it a report: a header row and columns that line up, with the…

    Write the code Medium 2 stages strings split slicing f-strings