Challenge
Line to record
…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.
Showing 21–30 of 92
Challenge
…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
Replace three copy-pasted tank-status blocks with a list of (name, level) pairs and one loop, keeping the output exactly the same, then add a fourth tank with a single list item and list the low…
Challenge
The cabin CO2 sensor sends a reading every minute, and the list of readings only grows. The crew's dashboard doesn't want all of them: it shows the five most recent, so a change is easy to spot. Slice…
Quiz
…data types: 15 questions on int, float, str, bool, None, lists, tuples, dictionaries and sets, with instant answers.
Example
…can return complex data structures like dictionaries or lists.
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
Summarise a list of engine readings with min(), max() and a mean from sum() / len(), then add the spread and make the summary cope with an empty list instead of crashing.
Challenge
Print a pre-flight checklist numbered from 1 with enumerate(list, start=1), then tick off the items the crew has already done with [x] and leave the rest as [ ].
Challenge
Apply a day's crew changes to a list: append() a new member, insert() a backup at position 1, remove() someone who left, then pop() the newest member and print who was reassigned.
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.