7.2, commissioning (no completion)

1, the assertion assert

assertMeaning that the expression n != 0should be True, otherwise, according to the logic of the program is running, the code behind will certainly be wrong.

If the assertion fails, the assertstatement itself will throwAssertionError

 

 Python interpreter may start with -Oparameters close assert:

$ python -O err.py
Traceback (most recent call last):
  ...
ZeroDivisionError: division by zero


logging

Guess you like

Origin www.cnblogs.com/soberkkk/p/12638237.html