<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _assertIndex(self, index):
 """Raise TypeError or IndexError if index is not an integer or out of range for the number of elements in this array, respectively. """

        if type(index) is not int:
            raise TypeError('list indices must be integers')
        if index < 0 or index >= self.nelems:
            raise IndexError('list index out of range')