Results for “counting”

8 results

  1. Challenge

    Counter

    Refactor the level counter from "Entries per level": replace the dict and counts.get() with collections.Counter, which starts every key at 0, then list the levels from most to least common with…

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  2. Challenge

    Entries per level

    Count the mission log's entries per level, INFO, WARN and ERROR, in a dict of counters, then count any level at all with get() when DEBUG lines turn up, and print the levels in alphabetical order.

    Write the code Easy 2 stages dictionaries counting get sorted
  3. Challenge

    Mission elapsed time

    …wants the mission elapsed time: how long since launch. Counting days and hours by hand across month ends goes wrong eventually, and the ground stations don't even agree on a time zone. Let the…

    Write the code Medium 2 stages datetime timedelta ISO 8601 time zones
  4. Challenge

    Log analyser

    …2 By hour: 09:00: 4 10:00: 4 11:00: 5 Two Counter s do the counting; the hour is the first two characters of the time, plus ":00" . The first error Find the first ERROR entry and print its time…

    Write the code Hard 3 stages project logs parsing Counter
  5. Challenge

    First error

    …one Find the first ERROR entry, print its line number, counting from 1, with the entry itself, and stop searching there: First error on line 4: [T+00:14:47] ERROR Fuel valve 2 not responding Loop with…

    Write the code Easy 2 stages for loop break enumerate flags