Rows You Can Trust

Python for AIMedium+10 XP+10

Rows You Can Trust

A sensor records rows of percentage readings. A row is only usable if:

  • none of its readings are missing (missing readings are None), and
  • every reading is between 0 and 100, both ends included.

Task: write usable_rows(rows) that returns the positions (starting at 0) of the usable rows, in order.

  • An empty row has nothing wrong with it, so it counts as usable.
  • No rows at all gives [].

Examples

rows = [[12, 40.5], [7, None], [101, 3], [100, 0]]
returns [0, 3]
rows = [[None, None], [50]]
returns [1]

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run