def run_stack(): s = MyStack() s.push(5) v = s.pop() result = v == 5 print("valid push/pop?: {}".format(result)) try: s.pop() except StopIteration as e: print('correct exception throw')
def __init__(self, size=10): self.push_stack = MyStack(size=size) self.pop_stack = MyStack(size=size)