def look_and_say(n):
    """Returns the nth term of the "look and say" sequence, which is defined as follows: beginning
    with the term 1, each subsequent term visually describes the digits appearing in the previous term.
    The first few terms are as follows:

    1
    11
    21
    1211
    111221

    Ex: the fourth term is 1211, since the third term consists of one 2 and one 1.
    """
    assert n, "There is no zeroth term."
    if n == 1:
        return 1
    else:
        s = str(look_and_say(n-1))
        res = ''
        i = 0
        while i in range(len(s)):
            count = 1
            num = s[i]
            while i in range(len(s)-1) and s[i] == s[i+1]:
                count += 1
                i += 1
            res += str(count) + num
            i += 1
        return int(res)