def check_list_type(L, t):
    """Checks that every element in L is of type t."""
    for i, l in enumerate(L):
        if not isinstance(l, t):
            raise TypeError("type '{}' not found in list at index [{}]".
                format(t, i))
    return True
