1 # 列表
2
3 >>>>>>查询
4 索引 list[index]
5 切片 list[start, end, step]
6
7 list.count(value) # 统计某个元素在列表中出现的次数
8 list.index(value) # 查找某个元素在列表中具体的位置(索引)
9
10 >>>>>>添加
11 list.append(value) #默认最后一个位置
12 list.insert(index, value) # 数据插入任何一个位置
13 list_a.extend(list_b) # 将B列表添加至A列表
14
15 >>>>>>修改
16 list[index] = value
17 list[start: end] = [values]
18
19 >>>>>>删除
20 list.remove(value) # 删除对应内容
21 list.pop(index) # 删除并返回值
22
23 del list, del list[index]
24 list.clear() # 清空列表
25
26 >>>>>>排序
27 list.reverse() # 倒序
28 list.sort() # 其对列表进行原址排序,既然是原址排序,按ASCII编码顺序
29