names = ["张三","李四","王五","麻六"] names.append("赵二")#添加 names.insert(0,"赵二")#指定插入 names.reverse()#反转 names.sort()#排序 names2 = [1,2,3,4] names.extend(names2)#扩展 del names2#删除 name2 =names.copy()#复制 names.clear()#清空. names.count("赵二")#统计重名 names[5] = "刘七"#替换 names.remove("张三")#删除 names.pop()#默认删除最后一个,可以加指定删除 print(names.index("王五"))#查找
标签:10,names2,删除,列表,学习,赵二,names,王五 From: https://www.cnblogs.com/Jiuqian/p/16757843.html