Skip to content

Commit 985c4e7

Browse files
committed
list 2
1 parent 8cae778 commit 985c4e7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎112.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ list.extend(L) 等效于 list[len(list):] = L,L是待并入的list
181181
这里讲述的两个让列表扩容的函数`append()`和`extend()`。从上面的演示中,可以看到他们有相同的地方:
182182

183183
- 都是原地修改列表
184-
- 既然是原地修改,就不返回值(这点特别要注意,没有返回值,就不能赋值给某个变量)
184+
- 既然是原地修改,就不返回值
185+
186+
原地修改没有返回值,就不能赋值给某个变量。
185187

186188
>>> one = ["good","good","study"]
187189
>>> another = one.extend(["day","day","up"]) #对于没有提供返回值的函数,如果要这样,结果是:

0 commit comments

Comments
 (0)