human
I am working on the file "Python/Chapter-07/ListMap.ipynb".
The first task is:
The class ListMap implements a map using a linked list of key-value pairs.  Basically, it is a wrapper for the class
ListNode.  Furthermore, an object of type ListMap is iterable.
Can you write Python code for it?
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.

class ListMap:
    def __init__(self):
        self.mPtr = None
        
    def find(self, key):
        if self.mPtr != None:
            return self.mPtr.find(key)
        
    def insert(self, key, value):
        if self.mPtr != None:
            return self.mPtr.insert(key, value)
        else:
            self.mPtr = ListNode(key, value)
            return True
            
    def delete(self, key):
        if self.mPtr != None:
            self.mPtr, flag = self.mPtr.delete(key)
            return flag
        return False
            
    def __iter__(self):
        return MapIterator(self.mPtr)
            
    def __str__(self):
        if self.mPtr != None:
            return '{' + self.mPtr.__str__() + '}'
        else:
            return '{}'
    
    def __repr__(self):
        return self.__str__()