Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Created April 25, 2020 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/1ad62682d898981658a92c529c9f03e7 to your computer and use it in GitHub Desktop.
Save computer-tutor/1ad62682d898981658a92c529c9f03e7 to your computer and use it in GitHub Desktop.
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