def count ( self , elem ) : return self . _left_list . count ( elem ) + self . _right_list . count ( elem )
count elements in queue of python
Return the number of elements equal to elem present in the queue
def count(self, elem):
        """
        Return the number of elements equal to elem present in the queue

        >>> pdeque([1, 2, 1]).count(1)
        2
        """
        return self._left_list.count(elem) + self._right_list.count(elem)