Results for “mean”

Showing 1–10 of 24

  1. 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…

    Fix the code Easy 2 stages statistics mean median stdev
  2. Challenge

    Readings summary

    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.

    Write the code Easy 2 stages lists min max sum
  3. Challenge

    Edge cases

    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…

    Write the code Medium 2 stages testing assert edge cases None
  4. Challenge

    Summary function

    …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.

    Write the code Medium 2 stages functions return dictionaries min
  5. Challenge

    Flag from config text

    …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…

    Fix the code Easy 3 stages bool if else config
  6. Challenge

    Any number of values

    …, 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…

    Write the code Easy 2 stages functions *args unpacking keyword-only arguments
  7. Challenge

    Off-by-one slice

    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.

    Fix the code Easy 3 stages strings slicing indexing off-by-one
  8. Challenge

    Missing reading

    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…

    Write the code Medium 2 stages if else None is None