Python中assert的用法
来源:互联网 发布:mac中的照片怎么导出 编辑:程序博客网 时间:2024/05/16 09:51
Python中assert的用法
Python中assert用来判断语句的真假,如果为假的话将触发AssertionError错误
如:
>>> a = 23
>>> a
23
>>> assert a == 23
>>> a -=1
>>> a
22
>>> assert a == 23
Traceback (most recent call last):
File "", line 1, in
assert a == 23
AssertionError
>>>
0 0
- Python中assert的用法
- Python中assert函数的用法小结
- Python-assert的用法
- [Python]断言assert的用法
- python assert断言的用法
- VC中ASSERT的用法
- VC中ASSERT的用法
- java中Assert的用法
- VC中ASSERT的用法
- java中Assert的用法
- C++中assert的用法
- VC中ASSERT的用法
- C++中assert的用法
- C++中 assert的用法
- C++中assert的用法
- c++ 中assert的用法
- Java中assert的用法
- java中Assert的用法
- [AndroidUI]自定义view(一)
- 云的初步认识
- 布线问题
- 黑马程序员 Java基础——Map接口及其实现类
- 归档备忘!
- Python中assert的用法
- iOS学习笔记34-Apple Watch两个月开发的一些收获总结
- 为什么匿名内部类和局部内部类只能访问final变量
- tiled map中折线的提取
- 3盏灯和3个开关的对应关系
- ACE常用的Strategized Locking Pattern
- POJ 1094 Sorting It All Out(拓扑排序)
- android中操纵sqlite数据库
- spring-session实例