Challenge
Wrong average
An average of three hull temperatures comes out at 47 °C when every sensor reads about 21. Predict it, find where the brackets are missing, fix it, then work out an average speed.
Showing 1–10 of 12
Challenge
An average of three hull temperatures comes out at 47 °C when every sensor reads about 21. Predict it, find where the brackets are missing, fix it, then work out an average speed.
Challenge
Write average(*values), which accepts any number of numbers, call it with loose values and with a list unpacked by *, then add a keyword-only decimals option after *values and return None when there…
Challenge
…File "script.py", line 20 File "script.py", line 16, in average_kelvin File "script.py", line 10, in to_kelvin KeyError: 'temperature_c' Read it from the bottom: the last line is the error, and the…
Challenge
…summary_line(sensor, values) returns one report line: the average rounded to one decimal place, the highest value, and HOT when it is over 450, otherwise OK . Then print the report with a loop over a…
Challenge
…and a totals line with the alerts added up and the average uptime: ========================================== DAILY MISSION REPORT Lumen-3 · 2026-11-05 ==========================================…
Example
Function can return multiple values as a tuple. Unpacking on assignment.
Example
Order of operations in Python. Parentheses, exponents, multiplication, division, addition.
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…
Example
Addition, subtraction, multiplication and division in Python. Basic arithmetic operations.
Example
Break (exit) and continue (skip) statements for flow control in loops.