sentence=['All', 'good', 'things', 'come', 'to' ,'those', 'who', 'wait.']
print("默认为 index=-1,删除最后一个列表值:",sentence.pop(-1),"\n")
print("默认删除最后一个列表值: ",sentence.pop(),"\n")
print("删除第一个元素:",sentence.pop(0),"\n")
print("删除第三个元素:",sentence.pop(2),"\n")
print("输出剩余元素:",sentence)
二、 单独执行每一行print()函数:
sentence=['All','good','things','come','to','those','who','wait']
print("默认为 index=-1,删除最后一个列表值:",sentence.pop(-1),"\n")
sentence1=['All','good','things','come','to','those','who','wait']
print("默认删除最后一个列表值:",sentence1.pop(),"\n")
sentence2=['All','good','things','come','to','those','who','wait']
print("删除第一个元素:",sentence2.pop(0),"\n")
sentence3=['All','good','things','come','to','those','who','wait']
print("删除第三个元素:",sentence3.pop(1),"\n")