python-small-examples/md/6.md at master · data-python/python-small-examples

Skip to content

Navigation Menu

Sign in

Appearance settings

Latest commit

File metadata and controls

19 lines (15 loc) · 452 Bytes

@author jackzhenguo
@desc 判断是真是假
@date 2019/2/12

6 判断是真是假  

测试一个对象是True, 还是False.

In [9]: bool([0,0,0])                                                           
Out[9]: True

In [10]: bool([])                                                               
Out[10]: False

In [11]: bool([1,0,1])                                                          
Out[11]: True