删除并返回下标 i 处的元素,默认最后一个。
i
被删除的元素
stack = [1, 2, 3] print(stack.pop(), stack) print(stack.pop(0), stack)
3 [1, 2] 1 [2]