循环
sentence = [‘All’, ‘good’, ‘things’, ‘come’, ‘to’, ‘those’, ‘who’, ‘wait’]
print(“默认为 index=-1,删除最后一个列表值:”, sentence.pop(-1), “\n”,sentence)
sentence1 = [‘All’, ‘good’, ‘things’, ‘come’, ‘to’, ‘those’, ‘who’, ‘wait’]
print(“默认删除最后一个列表值:”, sentence1.pop(), “\n”,sentence1)
sentence2 = [‘All’, ‘good’, ‘things’, ‘come’, ‘to’, ‘those’, ‘who’, ‘wait’]
print(“删除第一个元素:”, sentence2.pop(0), “\n”,sentence2)
sentence3 = [‘All’, ‘good’, ‘things’, ‘come’, ‘to’, ‘those’, ‘who’, ‘wait’]
print(“删除第三个元素:”, sentence3.pop(1), “\n”,sentence3)