assent
断言
当该关键字后面的条件为假,程序自动崩溃并抛出AssertionError异常
举例:
>>> assert 3 > 4
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
assert 3 > 4
AssertionError
assent
断言
当该关键字后面的条件为假,程序自动崩溃并抛出AssertionError异常
举例:
>>> assert 3 > 4
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
assert 3 > 4
AssertionError