Results for “items”

Showing 1–10 of 56

  1. Challenge

    API response

    …response, then list every field the response has with items(), the way you'd inspect an API you haven't used before.

    Write the code Easy 2 stages dictionaries keys items JSON
  2. Challenge

    Numbered checklist

    …from 1 with enumerate(list, start=1), then tick off the items the crew has already done with [x] and leave the rest as [ ].

    Write the code Easy 2 stages for loop enumerate start lists
  3. Challenge

    Manifest validator

    Write problems(item), which lists everything wrong with one cargo item: missing fields, a mass that isn't a number, is 0 or is over the limit. Print a pass or fail line per item, then catch duplicate…

    Write the code Medium 2 stages project validation dictionaries functions
  4. Challenge

    Crew roster

    …4 Indexes start at 0, as in strings. crew[-1] is the last item whatever the list's length, and len(crew) counts the items. The whole roster Add the second in command, who is second in the list, and…

    Write the code Easy 2 stages lists indexing negative index len
  5. Challenge

    Validate a cargo record

    Write validate_cargo(item), 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…

    Write the code Medium 2 stages functions return lists validation
  6. Challenge

    Manifest line

    Unpack an (id, item, mass_kg) tuple into three named variables and print a cargo manifest line, then fix the ValueError when the manifest adds a fourth field.

    Write the code Easy 2 stages tuples unpacking ValueError formatting
  7. 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
  8. Challenge

    Approved payloads

    …ID is on the approved list with in, which matches whole items rather than parts of text, then normalise IDs typed by hand and print a clear cleared or not-cleared message.

    Write the code Easy 2 stages lists in membership if
  9. Challenge

    Print the manifest

    In "Manifest line" you printed one item from a tuple. The logistics system now exports the whole manifest as a list of dicts, one per item, with an ID, a name, a category and a mass. The loading crew…

    Write the code Easy 2 stages dictionaries lists of dicts for loop formatting
  10. Challenge

    Filter the log

    Go through the mission log and build a new list holding only the WARN and ERROR entries with append(), then let a minimum level decide what counts, the way logging tools filter by severity.

    Write the code Medium 2 stages for loop lists append filtering