<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def isbn10(self):
        '''
        Encode ISBN number in ISBN10 format
        Raises exception if Bookland number different from 978
        @rtype:  string
        @return: ISBN formated as ISBN10
        '''
        if self._id[0:3] != '978':
            raise ISBNError("Invalid Bookland code: {}".format(self._id[0:3]))
        digit10 = _digit10(self._id[3:12])
        if digit10 == 10:
            return self._id[3:12] + 'X'
        else:
            return self._id[3:12] + str(digit10)