Python assert 用法
官方文档解释(https://docs.python.org/3/reference/simple_stmts.html#assert), "Assert statements are a convenient way to insert debugging assertions into a program".
即
assert condition
如果condition为False,则报错“AssertionError”
官方文档解释(https://docs.python.org/3/reference/simple_stmts.html#assert), "Assert statements are a convenient way to insert debugging assertions into a program".
即
assert condition
如果condition为False,则报错“AssertionError”