Skip to content

Commit 15c1cc3

Browse files
committed
Update 111.md
补充一个list切片用法
1 parent b9872ed commit 15c1cc3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

111.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
['2', 3] #不包含结束位置
7171
>>> a[1:]
7272
[3, 'qiwsir.github.io']
73+
>>> a[2][7:13] #可以对列表元素做2次切片
74+
'github'
7375

7476
list和str两种类型的数据,有共同的地方,它们都属于序列(都是一些对象按照某个次序排列起来,这就是序列的最大特征),因此,就有很多类似的地方。如刚才演示的索引和切片,是非常一致的。
7577

0 commit comments

Comments
 (0)