Challenge
Prove the fix
…this: one that ignores the log it is given, and one that returns a copy instead of adding to it.
Showing 51–60 of 78
Challenge
…this: one that ignores the log it is given, and one that returns a copy instead of adding to it.
Challenge
A 40-line pre-burn check has five bugs: a syntax error, a type error, a wrong key, an index out of range and a reversed decision. Read each error to fix the four that crash, then find the one that…
Challenge
The telemetry pipeline is now split into parse_row() and check_limits(). Write assert tests for both, good rows, rejected rows and readings right at a limit, so that each of three planted bugs makes…
Challenge
Write assert checks for alert_level(): one temperature for each level first, then the values exactly on each threshold and just below them, so a > written instead of >= can't slip through.
Challenge
Refactor the temperature summary: delete the hand-written mean() and median() and use statistics.mean() and statistics.median() instead, then add the standard deviation and handle passes with too few…
Challenge
A call to schedule_launch() passes the pad where the rocket belongs, and the board says a launch pad is flying. Predict the line, find which parameter got which value, fix it with keyword arguments…
Challenge
…load_config() Move the work into load_config(text) , which returns (config, problems) and never crashes. Text that is not valid JSON is one problem, not valid JSON: and the error's msg ; JSON that is…
Challenge
…that lets bugs through Write parse_pressure(text) , which returns the number, or None when the text is not a number. Catch only ValueError , so a bug such as parse_pressure(None) still raises its…
Challenge
Write assert checks for mean(): an ordinary list and a list with one value first, then the edge cases, an empty list that should give None and lists with negative values, so broken copies of the…
Challenge
The monitoring system raises the same alert over and over. Group repeats of an alert that come within 60 seconds of the first into one line with a count, in the order they first appeared, then add the…