Results for “records”

Showing 1–10 of 22

  1. Challenge

    Line to record

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

    Validate a cargo record

    …which returns a list of everything wrong with a cargo record: missing fields and a negative mass, then a cargo ID that doesn't match the CG- and four digits format. An empty list means the record is…

    Write the code Medium 2 stages functions return lists validation
  3. 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
  4. Challenge

    Logging instead of print

    …them with logging calls at the right levels, so debug records stay hidden until switched on, then give the fuel code its own named logger.

    Fix the code Medium 2 stages logging debug info warning
  5. Article Mini projects

    Managing Astronaut Medical Data with Python

    …tables: astronauts : To store personal information medical_records : To keep track of medical check-ups Let's write some Python code to set up our database and main class, and then instantiate that…

  6. Challenge

    Index by ID

    Build a dict that maps every cargo ID to its record, so any item is found with one lookup instead of a search through the list, then answer a list of requests, including an ID that isn't on the…

    Write the code Medium 2 stages dictionaries indexing lookup in
  7. Challenge

    Shared default list

    …['CABIN 101.2'] Make: A fresh list every time Write new_record(sensor, value, flags=None) , which returns a dict with a fresh flags list whenever none is given. The program flags the first record, and…

    Fix the code Medium 3 stages functions default values mutable defaults None
  8. Challenge

    Test the parser

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

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

    Launch counter crash

    record_launch() adds 1 to a global counter and stops with an UnboundLocalError. Predict it, find out why Python treats the name as local, fix it by passing the count in and returning the new one, then…

    Fix the code Medium 3 stages functions scope UnboundLocalError global