python: assert 内建函数
来源:互联网 发布:怎样分析天然气数据 编辑:程序博客网 时间:2024/06/05 10:06
Syntax
assert expression [, arguments]
当 expression (表达式)
的 bool类型 为 False 时,如果 arguments
被定义了,则抛出 arguments ,否则抛出 AssertionError 。
Test
assert False, "Hello" # AssertionError: Helloassert 1 == 1, "Hello" assert 1 == 2, "Hello" # AssertionError: Hello
阅读全文
0 0
- python: assert 内建函数
- Python assert 断言函数
- Python 内建函数
- Python内建函数
- Python内建函数
- Python 内建函数
- python 内建函数
- python内建函数
- Python内建函数
- Python 内建函数
- Python--内建函数
- python-内建函数
- python 内建函数
- Python--内建函数
- python内建函数
- python内建函数
- python 内建函数
- python内建函数
- 数据结构实验之查找五:平方之哈希表
- 常用的数据库脚本
- 如何修复 ubuntu 中检测到系统程序错误的问题
- HMM的个人理解
- HTTP缓存机制及原理
- python: assert 内建函数
- java调用c,封装成dll
- ubuntu16.04 --- tesseract安装教程
- Linux查看进程及所占端口
- recttransform 和transform unity
- HDU 1711
- 背包系列
- mysql常用命令
- OC学习篇之---Foundation框架中的NSArray类和NSMutableArray类