LessonΒ·difficulty 2/5Β·~15 min
Clean sensor readings
Implement valid_readings(values).
values contains numbers or None. Return the numbers in the inclusive range 0 to 100, in their original order. Keep zero; discard None and out-of-range values. Do not mutate the input.
Before coding, predict one result by hand. After the tests pass, explain your approach and add a boundary example of your own.
Tests
- Case 1
- Case 2
- Case 3
- Case 4
β¦ Stuck? Ask for a spark
Sign in or create a free account to use your monthly AI explainer allowance.
warming up
Loading editorβ¦
Consolewaiting
$ Console output will appear here.