dequeue( enqueue( enqueue( figure abstract view of the queue after performing additional operations empty queue by examining the length of the list the complete python list-based implementation is provided in listing and an instance of the class is illustrated in figure on the next page to enqueue an itemwe simply append it to the end of the list the dequeue operation can be implemented by popping and returning the item in the first listing the pylistqueue py module implementation of the queue adt using python list class queue creates an empty queue def __init__self )self _qlist list(returns true if the queue is empty def isemptyself )return lenself = returns the number of items in the queue def __len__self )return lenself _qlist adds the given item to the queue def enqueueselfitem )self _qlist appenditem removes and returns the first item in the queue def dequeueself )assert not self isempty()"cannot dequeue from an empty queue return self _qlist pop