📜  python代码示例中的pop函数

📅  最后修改于: 2022-03-11 14:47:16.658000             🧑  作者: Mango

代码示例6
# removes last element of list unless parameter is given
l1 = [1,2,3,4,5]
print(l1.pop()) # returns [1, 2, 3, 4]
print(l1.pop(2)) # returns [1, 2, 4, 5] removes element at given index