<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def angle(self, vec, unit='rad'):
 """Calculate the angle between two Vectors unit: unit for returned angle, either 'rad' or 'deg'. Defaults to 'rad' """

        if not isinstance(vec, self.__class__):
            raise TypeError('Angle operand must be of class {}'
                            .format(self.__class__.__name__))
        if unit not in ['deg', 'rad']:
            raise ValueError('Only units of rad or deg are supported')

        denom = self.length * vec.length
        if denom == 0:
            raise ZeroDivisionError('Cannot calculate angle between '
                                    'zero-length vector(s)')

        ang = np.arccos(self.dot(vec) / denom)
        if unit == 'deg':
            ang = ang * 180 / np.pi
        return ang