Challenge
Print the manifest
Print one cargo manifest line for every record in a list of dicts, reading each field by key, then add up the masses in the same loop for a total line.
Showing 1–10 of 22
Challenge
Print one cargo manifest line for every record in a list of dicts, reading each field by key, then add up the masses in the same loop for a total line.
Challenge
…doesn't keep everything at the top level: the rocket is a dict of its own, and the mission holds a list of patch images. The public launch page shows the rocket and the mission patch. Dig the two…
Challenge
Print only the launches whose status is Go from a list of launch dicts, then collect the others with their status into one "not go yet" line, or none.
Challenge
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.
Challenge
…remembers samples from earlier calls, because the default list is created once and shared. Predict it, prove the calls share one list, fix it with None as the default, then write a function that hands…
Challenge
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…
Challenge
…console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.
Challenge
…the rota, and check its own work. In turn Build rota , a list of (day, shift, name) tuples for every shift of the week, in order, taking the crew in turn. Print one line per day, then count how many…
Challenge
…which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.
Challenge
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…