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…
8 results
Challenge
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…
Challenge
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.
Challenge
…then find the longest stretch with no station in contact, counting overlapping passes only once.
Challenge
…in rocket_got , and the position of the pad in the call, counting from 1, in pad_position . Modify. Pass every argument by name, keeping the pad before the rocket in the call, so you can see the order…
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
…For the last character, a negative index saves you counting.