class Queue: """A sample implementation of a First-In-First-Out data structure.""" def __init__(self): self.in_stack = [] self.out_stack = [] def push(self, obj): self.in_stack.append(obj) def pop(self): if not self.out_stack: while self.in_stack: self.out_stack.append(self.in_stack.pop()) return self.out_stack.pop()