<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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