assent
斷言
當(dāng)該關(guān)鍵字后面的條件為假,程序自動崩潰并拋出AssertionError異常
舉例:
>>> assert 3 > 4
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
assert 3 > 4
AssertionError
assent
斷言
當(dāng)該關(guān)鍵字后面的條件為假,程序自動崩潰并拋出AssertionError異常
舉例:
>>> assert 3 > 4
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
assert 3 > 4
AssertionError