Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
WuShichao committed Oct 5, 2018
1 parent 6b9cd70 commit a24e0b8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions 04.basis.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,37 @@ r"Newlines are indicated by \n"
* _集合:set(),无序不重复元素集_
* _字典:dict(),描述映射关系的无序集合_

### 布尔类型

布尔类型常用于逻辑判断。
函数: bool(); 运算符: not,or,and; 测试: in,is
我们现在通过下面2段例子学习其用法:

'''python
>>> bool('')
False
>>> bool('hello')
True
>>> a = None
>>> b = 1
>>> bool(a)
False
>>> bool(b)
True
'''

'''python
>>> not 1==3
True
>>> 1>2 or 2>1
True
>>> (1>2) + (2>1)
1
>>> (1>2) and (2>1)
False
>>> (1>2) * (2>1)
0
'''

## 对象

Expand Down

0 comments on commit a24e0b8

Please sign in to comment.