Results for “return”

Showing 41–50 of 78

  1. Challenge

    Launch schedule digest

    …Cargo 4 (NASA) A small function such as window(launch) , returning the parsed datetime, works for the comparison and as the key for sorted() . strftime("%Y-%m-%d %H:%M") formats a datetime. Time left…

    Write the code Medium 3 stages project json datetime timedelta
  2. Challenge

    Manifest validator

    …go. Every problem, per item Write problems(item) , which returns a list of everything wrong with one item: each field from REQUIRED that is missing, in that order, then a mass that is not a number, is…

    Write the code Medium 2 stages project validation dictionaries functions
  3. Challenge

    Flight software review

    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…

    Fix the code Hard 2 stages project debugging SyntaxError TypeError
  4. Challenge

    Test the pipeline

    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…

    Write the code Hard 2 stages project testing assert try
  5. Challenge

    Read the traceback

    A Python program stops with a traceback. 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.

    Fix the code Easy 2 stages errors traceback KeyError TypeError
  6. Challenge

    Test the alert levels

    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.

    Write the code Medium 2 stages testing assert functions boundaries
  7. 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