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…
Showing 41–50 of 78
Challenge
…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…
Challenge
…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…
Challenge
…this: one that ignores the log it is given, and one that returns a copy instead of adding to it.
Quiz
…and continue Functions: default values, keyword arguments, returning several values and variable scope How it works 20 questions: 15 with one correct answer, 5 where you select every correct answer…
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
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.
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.
Example
Parameters can have default values. Used when argument is not provided.
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…