如有错误欢迎指正 配合if判断语句使用raise可以终止当前程序 Python raise用法(超级详细,看了无师自通) (biancheng.net) Python3 assert(断言) | 菜鸟教程 (runoob.com)