<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nth(iterable, n, default=None):
 """Returns the nth item or a default value Arguments --------- iterable : iterable n : int default : default=None The default value to return """


        if type(n) != int:
            raise TypeError("n is not an integer")

        return next(islice(iterable, n, None), default)