Stack implementation using tuples in python