Challenge
Extra log fields
…are added to the line as key=value pairs, then pass whole dicts of fields into it with ** at the call.
Showing 11–20 of 37
Challenge
…are added to the line as key=value pairs, then pass whole dicts of fields into it with ** at the call.
Challenge
…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
…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 most_common().
Challenge
Turn the day's mission summary dict into JSON text with json.dumps() and indent=2, see what True, False and None become, then keep the station's Polish letters readable and sort the keys so the files…
Challenge
…to record" into parse_line(line), which returns the record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
…that maps planets and the Moon to surface gravity with a dict and one get() lookup, keeping the output exactly the same, then loop over the dict for a weight table.
Challenge
…flag, save. Validate the rows Read telemetry.csv with csv.DictReader . Reject a row whose sensor is not in LIMITS , or whose value is not a number, with its line number in the file: the header is line…
Challenge
…True alerts: all DEFAULTS.copy() makes a separate dict, and settings.update(user_settings) overwrites the keys the user set. Unknown settings A user's profile has a typo: "dark_mod" . With update() it…
Challenge
…= "DEBUG" retries = 12 safe_mode = "yes" timeout_s = 2.5 dict(DEFAULTS) makes the copy and update() fills it in. json.dumps(value) shows the difference between "256" and 256 . Every problem at once…
Challenge
…line, then save the same data as a CSV file with csv.DictWriter for the spreadsheet people.