assertIntermediate Playground

Debugging aid that tests a condition and raises AssertionError if false

Python Playground
Output
Click "Run" to execute your code

assert is ideal for checking invariants during development. Use it for conditions that should never be false in correct code.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?