Challenge
Statistics module
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…
Showing 1–10 of 24
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
Summarise a list of engine readings with min(), max() and a mean from sum() / len(), then add the spread and make the summary cope with an empty list instead of crashing.
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
…summarise(readings), which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.
Challenge
…or false , in any case and with stray spaces. Yes and true mean on; anything else means off. Print: Telemetry: on Telemetry: off Normalise the value first, as in "Normalise a command", then compare it…
Challenge
…that says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.
Challenge
…, which takes any number of numbers and returns their mean. Call it with three loose values, then with the readings list unpacked, and print: Three spot checks: 401.0 The whole pass: 419.5 Inside the…
Challenge
…match the CG- and four digits format. An empty list means the record is fine.
Challenge
A slice meant to take the number from the container tag CG-0042 gives -004. Predict it, work out where indexes start and where a slice ends, fix it, then slice a sample label yourself.
Challenge
Extend the alert check from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a…