Basic implementation of stack in python