pop()方法将删除指定的索引。如果未指定索引,则该方法将删除最后一项。
删除第二项:
fruitlist = ["apple", "banana", "cherry"]fruitlist.pop(1)print(fruitlist)
执行结果:
['apple', 'cherry']