def find ( self , name ) : for i , nm in enumerate ( self . data ) : if nm [ - 1 ] == name : return i return - 1
finding the index of an entry python
Return the index of the toc entry with name NAME .
def find(self, name):
        """Return the index of the toc entry with name NAME.

           Return -1 for failure."""
        for i, nm in enumerate(self.data):
            if nm[-1] == name:
                return i
        return -1