Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def push(stack, pin_code, city_name):
stack.append({'pin':pin_code, 'city':city_name})
pass
def pop(stack):
return stack.pop()
l=[]
push(l,842001, 'Muz')
push(l,110078, 'Delhi')
push(l, 820067,'Patna')
print(l)
print("Popped element is", pop(l))
print("Popped element is", pop(l))
print("Final List =",(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment