mums= [1] print("source:",mums)
whilelen(mums) <10: mums.append(len(mums)) print("while after:",mums)
mums.insert(2,"白萝卜") print("insert after:",mums)
mums.extend(["h","e","l","l","o"]) print("extend after:",mums)
mums.reverse() print("resverse after:",mums)
mums.pop(2) print("pop after:",mums)
mums.remove("e") print("remove after:",mums)
""" 对列表进行切片替换时,需要的是序列。当有步长时,需要的序列数量必须与切片的数量相同"""mums[::5] = ["python","is","easy"]
print("[]:",mums)
delmums[0] print("del:",mums)
mums.clear() print("clear after:",mums)