Skip to content

Commit 3262190

Browse files
committed
Merge pull request qiwsir#27 from dongm2ez/master
Update 116.md
2 parents e47f0ab + 7af6e63 commit 3262190

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎116.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
>>> person
5050
{'name': 'qiwsir', 'language': 'python', 'site': 'qiwsir.github.io'}
5151

52-
`"name":"qiwsir"`,有一个优雅的名字:键值对。前面的name叫做键(key),后面的qiwsir是前面的键所对应的值(value)。在一个dict中,键是唯一的,不能重复。值则是对应于键,值可以重复。键值之间用(:)英文的分号,每一对键值之间用英文的逗号(,)隔开。
52+
`"name":"qiwsir"`,有一个优雅的名字:键值对。前面的name叫做键(key),后面的qiwsir是前面的键所对应的值(value)。在一个dict中,键是唯一的,不能重复。值则是对应于键,值可以重复。键值之间用(:)英文的冒号,每一对键值之间用英文的逗号(,)隔开。
5353

54-
>>> person['name2']="qiwsir" #这是一种向dict中增加键值对的方法
54+
>>> person['name2'] = "qiwsir" #这是一种向dict中增加键值对的方法
5555
>>> person
5656
{'name2': 'qiwsir', 'name': 'qiwsir', 'language': 'python', 'site': 'qiwsir.github.io'}
5757

@@ -79,7 +79,7 @@
7979

8080
或者用这样的方法:
8181

82-
>>> ad = dict(name="qiwsir", age=42)
82+
>>> ad = dict(name = "qiwsir", age = 42)
8383
>>> ad
8484
{'age': 42, 'name': 'qiwsir'}
8585

@@ -167,7 +167,7 @@ dict数据类型是以键值对的形式存储数据的,所以,只要知道
167167
>>> city_code
168168
{'suzhou': '0512', 'beijing': '010', 'shanghai': '012', 'tangshan': '0315', 'nanjing': '025'}
169169

170-
突然发现北京的区号写错了。可以这样修改。这进一步说明字典是可变的。
170+
突然发现北京的区号写错了。可以这样修改。这进一步说明字典的值是可变的。
171171

172172
>>> city_code["shanghai"]
173173
'012'

‎120.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124

125125
|运算符 | 描述 | 实例 |
126126
|-------|-------|-------|
127-
|and | 布尔"与" - 如果x为False,x and y返回False,否则它返回y的计算值。| (a and b) 返回 true。|
128-
|or | 布尔"或" - 如果x是True,它返回True,否则它返回y的计算值。| (a or b) 返回 true。|
127+
|and | 布尔"与" - 如果x为False,x and y返回False,否则它返回y的计算值。| (a and b) 返回 20。|
128+
|or | 布尔"或" - 如果x是True,它返回True,否则它返回y的计算值。| (a or b) 返回 10。|
129129
|not | 布尔"非" - 如果x为True,返回False。如果x为False,它返回True。 | not(a and b) 返回 false。|
130130

131131
- and
@@ -199,4 +199,4 @@ not,翻译成“非”,窃以为非常好,不论面对什么,就是要
199199

200200
[总目录](./index.md)   |   [上节:集合(2)](./119.md)   |   [下节:语句(1)](./121.md)
201201

202-
如果你认为有必要打赏我,请通过支付宝:**qiwsir@126.com**,不胜感激。
202+
如果你认为有必要打赏我,请通过支付宝:**qiwsir@126.com**,不胜感激。

0 commit comments

Comments
 (0)