题解 | #用列表实现栈#
用列表实现栈
https://www.nowcoder.com/practice/38187b9f30e44fdaa496751b82b0adbf
stack = [1, 2, 3, 4, 5] stack.pop(len(stack)-1) print(stack) stack.pop(len(stack)-1) print(stack) stack.append(int(input())) print(stack)
用列表实现栈
https://www.nowcoder.com/practice/38187b9f30e44fdaa496751b82b0adbf
stack = [1, 2, 3, 4, 5] stack.pop(len(stack)-1) print(stack) stack.pop(len(stack)-1) print(stack) stack.append(int(input())) print(stack)
相关推荐