Python program to implement stack. Stack is a LIFO data structure. Stack operations: PUSH(insert operation), POP(Delete operation) and Display stack.
I'm not pride to do this (in python) at that way, but is didactic for public from other languages and beginners. For a good perfomance use from collections import deque.
Other option is using Lists as Stacks, methods is append and pop.
To test, do the command:
run test.py
To test with List, do the command:
run testasList.py