Somewhere, Something Incredible Is Waiting To Be Known !!!
(Move to ...)
Home
▼
Saturday, 18 April 2020
Python Stack push() pop()
stack = []
def push(val):
stack.append(val)
def pop():
val = stack[-1]
del stack[-1]
return val
push(3)
push(2)
push(1)
print(pop())
print(pop())
print(pop())
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment