Challenge
Prints instead of returns
to_kelvin() prints its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that…
Showing 1–10 of 39
Challenge
to_kelvin() prints its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that…
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
…waypoints in a dict and find the nearest one with the same function.
Challenge
In "Readings summary" you printed the min, max and mean of one pass. Now the dashboard, the daily report and the alert system all need those numbers, each in its own format, for every pass, including…
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
…statuses give None, make every path return, then write a function where every path returns.
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
…character, then add assert tests that would catch either function breaking.
Challenge
…the count in and returning the new one, then write a fuel function the same way.
Challenge
refuel() assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write…