list methods
name = ["ha","niu","ding",[1,3,45,3],"ju","peng"]
print(name[1:3])# 切片
print(name[-2:]) # 拿后面的 输出的位 “ju”, “peng”
name.insert(1,"li") # 插入在niu的前面
name.insert(3,"qin") # 插入在niu 的后面
# 索引
print(name.index("ju"))
print([name.index("ju")])
print(name.count("ju")) # 查看“ju”有多少个
# sort 排序 reverse 反向
name.reverse()
name.sort()
# 扩展
name.append("dong") # 单个扩展
name.extend([1,2,3,4])# 多个扩展
# delete
name.remove("li")
del name[1]
name.pop()
name.pop(1) # del name[1]