1, the assertion assert
assert
Meaning that the expression n != 0
should be True
, otherwise, according to the logic of the program is running, the code behind will certainly be wrong.
If the assertion fails, the assert
statement itself will throwAssertionError
Python interpreter may start with -O
parameters close assert
:
$ python -O err.py
Traceback (most recent call last):
...
ZeroDivisionError: division by zero
logging