assert False,'列表元素个数小于5'
"Assert statements are a convenient way to insert debugging assertions into a program".
assert condition用来让程序测试这个condition,如果condition为false,那么raise一个AssertionError出来。逻辑上等同于:
assert False,'列表元素个数小于5'
"Assert statements are a convenient way to insert debugging assertions into a program".
assert condition用来让程序测试这个condition,如果condition为false,那么raise一个AssertionError出来。逻辑上等同于: