Lesson·difficulty 2/5·~15 min
Clean sensor readings
Read the task → edit your code → Run to see the output → Run tests to check your answer.
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
✦ Need help with this task?
Sign in or create a free account to get AI help. Free includes a monthly AI allowance.
warming up
Loading editor…
Consolewaiting
$ Console output will appear here.