题解 | #用列表实现栈#
用列表实现栈
https://www.nowcoder.com/practice/38187b9f30e44fdaa496751b82b0adbf
import sys stack = [1,2,3,4,5] a=int(input()) stack.pop(len(stack)-1) print(stack) stack.pop(len(stack)-1) print(stack) stack.append(a) print(stack)
用列表实现栈
https://www.nowcoder.com/practice/38187b9f30e44fdaa496751b82b0adbf
import sys stack = [1,2,3,4,5] a=int(input()) stack.pop(len(stack)-1) print(stack) stack.pop(len(stack)-1) print(stack) stack.append(a) print(stack)
相关推荐
记着呢:说的很对,已经工作近7年,就是觉得年轻的时候太多忧虑,没有好好玩一玩,虽然现在我也是很多忧心事,但是真的感觉年轻的时光才是最宝贵的,玩的开心,做自己喜欢的事,全力以赴,这才是应该做的