Python Validation and Error Handling
Save a Batch without Leaving Half an Update
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Return one ready-or-reject word per incoming reading. For [4, 8], return ["ready", "ready"].
The saved readings are [2]. Adding [4, 8] should produce [2, 4, 8]. A request containing zero, a negative number or text must leave the saved readings unchanged.
Inspect the component calculation
Check each reading( Incoming readings: Incoming batch Accept: positive numbers )
Examples and results
- Incoming batch
- 04
- 18
- Required result
- 0ready
- 1ready
- Incoming batch
- 07
- 1eight
- Required result
- 0ready
- 1reject
- Incoming batch
[]
- Required result
[]
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
This shows the resulting list without changing the source. It does not save a file or provide a database transaction. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.
A Later Request Contains Two Bad Readings
This check uses the pieces from “Check before Appending”.
BOTIE
- Saved readings
- 09
- 110
- Incoming batch
- 07
- 1true
- 23
- 3-4
Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
What should remain in the saved list if only the final incoming value fails?
Check the whole request before changing the saved data.
This shows the resulting list without changing the source. It does not save a file or provide a database transaction.