使用格式为: assert expression [, arguments] expression 为 False ,触发 arguments (相当于一个错误提示)expression 为 True ,程序继续执行,不会用任何提示: 参考自 python assert用法assert 官方解释