Other exception processing,

try block without exception, executes else

Regardless of whether the abnormal finally, will be executed

Active trigger abnormal raise TypeEroor ()

Custom exception

断言 assert条件——》assert res1 = 1 ——》if res1 !=1  raise AssertionError

When exception handling with: Only in some abnormal unforeseen circumstances, it should be added to try. . . except, other logical errors should be corrected as much as possible.

Guess you like

Origin www.cnblogs.com/jintian/p/10959167.html