stack-based queue yet another implementation of queue is to use two stacks once morethe python list class will be used to simulate stackclass queuedef __init__(self)self inbound_stack [self outbound_stack [the preceding queue class sets the two instance variables to empty lists upon initialization these are the stacks that will help us implement queue the stacks in this case are simply python lists that allow us to call push and pop methods on them the inbound_stack is only used to store elements that are added to the queue no other operation can be performed on this stack enqueue operation the enqueue method is what adds elements to the queuedef enqueue(selfdata)self inbound_stack append(datathe method is simple one that only receives the data the client wants to append to the queue this data is then passed to the append method of the inbound_stack in the queue class furthermorethe append method is used to mimic the push operationwhich pushes elements to the top of the stack to enqueue data onto the inbound_stackthe following code does justicequeue queue(queue enqueue( queue enqueue( queue enqueue( print(queue inbound_stacka command-line output of the inbound_stack inside the queue is as follows[