Challenge
Roster changes
…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.
9 results
Challenge
…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
…each line without its line break: [T+00:10:00] INFO Orbit insertion complete [T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not responding The hidden tests also open…
Challenge
…since launch, after the three lines from before: Orbit insertion: T+0:11:12 Solar array deployed: T+0:32:00 First image: T+3 days, 4:15:30 Parse each timestamp as it is, offset included, and subtract…
Challenge
Turn the launch-day mission log into answers: parse each line into a dict, count the entries per level and per hour, find the first ERROR, then rank the subsystems by how many warnings they raised.
Challenge
Count the entries and the WARN lines in a multi-line mission log with count(), fix the count when a message mentions WARN itself, then summarise the log by level.
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
Go through the mission log and build a new list holding only the WARN and ERROR entries with append(), then let a minimum level decide what counts, the way logging tools filter by severity.
Challenge
Scan the mission log for the first ERROR entry, print its line number with enumerate() and stop there with break, then report how many lines were checked, or that there were no errors at all.