mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 09:21:00 +03:00
parent
f21a011eb4
commit
4bca6a7dd4
@ -163,7 +163,7 @@ li[:3] # => [1, 2, 4]
|
||||
del li[2] # li 现在是 [1, 2, 3]
|
||||
|
||||
# 合并列表
|
||||
li + other_li # => [1, 2, 3, 4, 5, 6] - 并不会不改变这两个列表
|
||||
li + other_li # => [1, 2, 3, 4, 5, 6] - 并不会改变这两个列表
|
||||
|
||||
# 通过拼接来合并列表
|
||||
li.extend(other_li) # li 是 [1, 2, 3, 4, 5, 6]
|
||||
|
Loading…
Reference in New Issue
Block a user