NP29 用列表实现栈

This commit is contained in:
轩辕龙儿 2022-10-26 15:51:30 +08:00
parent ed9e1847f8
commit 603ffc167f

18
NP/NP29.py Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
# @author 轩辕龙儿
# @date 2022/10/26
# @file NP29.py
def solution():
num = int(input())
stack = [1, 2, 3, 4, 5]
stack.pop()
print(stack)
stack.pop()
print(stack)
stack.append(num)
print(stack)
if __name__ == "__main__":
solution()