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

posted @ 2017-02-07 15:05  Nowhere-man  阅读(961)  评论(0)    收藏  举报