Challenge
Log formatter function
…mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.
Showing 1–10 of 39
Challenge
…mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.
Challenge
…in one place and not the other. Turn the parsing into a function that any program can call, then let it decide on its own which lines are worth a record. parse_line() Move the parsing of one line into…
Challenge
…waypoints in a dict and find the nearest one with the same function.
Challenge
…the ones where the sensor sent nothing. Write one function that returns the whole summary, then make it safe for an empty pass. Four numbers in one dict Write summarise(readings) , which returns a…
Challenge
…Read it from the bottom up to find the error, the function and the line, fix the bug there, then follow a longer traceback through four calls to a second bug.
Challenge
…statuses give None, make every path return, then write a function where every path returns.
Challenge
Extend format_log() from "Log formatter function" with **fields, so any extra keyword arguments are added to the line as key=value pairs, then pass whole dicts of fields into it with ** at the call.
Challenge
…character, then add assert tests that would catch either function breaking.
Challenge
Sort launches by date with sorted() and a small function that returns each launch's date, then sort the cargo manifest heaviest first with a key function and reverse=True.
Challenge
…the count in and returning the new one, then write a fuel function the same way.