Results for “lists”

Showing 21–30 of 92

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

    Write the code Easy 2 stages dictionaries lists parsing records
  2. Challenge

    Copy-pasted blocks

    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…

    Fix the code Medium 2 stages refactoring for loop tuples lists
  3. Challenge

    Last five readings

    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…

    Write the code Easy 2 stages lists slicing negative slice append
  4. Challenge

    Readings summary

    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.

    Write the code Easy 2 stages lists min max sum
  5. Challenge

    Numbered checklist

    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 [ ].

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

    Roster changes

    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.

    Write the code Easy 2 stages lists append insert remove