上学期看了 ThinkPython,感觉后面的题目引申不错,于是写了写。
以及当时写了一些笔记,都扔在这里好了。
列表的操作主要有find, add, 切片, 归并, sort/sorted, map, 筛选(filter), 删除, list, split, join
0.其中add操作有append(添加一个元素并返回None), extend(添加一个列表);
1.这里的归并的定义是:将一系列的元素合并成一个单一值的操作;
2.删除操作有, pop:将移除指定下标的元素并返回最后一个元素; del:移除指定下标的元素,可移除多个元素,结合切片索引使用;remove:直接删除值,无需知道下标;
3.list:将一个字符串转换为字符的列表;