Results for “return”

Showing 51–60 of 78

  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

    Config loader

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

    Write the code Hard 3 stages project json configuration validation
  3. Challenge

    Catch what you expect

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

    Fix the code Medium 3 stages errors try except ValueError
  4. Challenge

    Alert deduplicator

    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…

    Write the code Hard 2 stages project dictionaries tuples as keys grouping
  5. Challenge

    Sign-up cleanup

    Clean the crew sign-ups for the analogue mission: trim and capitalise names, lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each…

    Write the code Medium 2 stages project strings strip split
  6. Challenge

    Extra log fields

    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.

    Write the code Medium 2 stages functions **kwargs keyword arguments dictionaries