Stacks / Constrains
Stacks are simply arrays with restrictions.
We can thing at a stack as a list displayed vertically.
Just like a stack of dishes, you can look only at the face of the top dish.
A handy acronym to describe stack operations is LIFO (last in, first out).
Lists / Python
In Python the stack is build-in
It is called list
and has append() and pop() methods.
mystack = 
print("Stack after insertion =", mystack)
front = mystack.pop()
print("Stack after deletion =", mystack)
print("Popped element, front =", front)
Most programming languages
doesn't come with a built-in stack data type.
Let's create a stack to see how it works
self.items = 
def push(self, item):
self.items += [item]
item = self.items[-1]
self.items = self.items[:-1]
stack = Stack()
print("Read from stack top =", stack.read())
popped = stack.pop()
print("Remove from stack top =",