Assert in Python: Output a Customized Message When the Assertion Fails
Assert in Python: Output a Customized Message When the Assertion Fails
If you want to output a customized message when the assertion fails, use assert condition, message. The code above is an example of an assertion with an alternative message.