Question: ```
lista = [["a", "b", "c"], ["d", "e", "f"]]

def check(temp_plan):
    if all(isinstance(elements, str) for elements  in temp_plan):
        return True
    else:
        return False

print(check(lista))

```

I know the code above returns false since the elements in the list are lists.

Answer: 
You are iterating the array `["a", "b", "c"]`, so `False` is no doubt the result when type-check with `str`

One solution is to flatten the n-dimensional array to 1-dimensional one and then check it (in the example I flatten the array using [`itertools.chain`](https://docs.python.org/3.8/library/itertools.html#itertools.chain))

```
import itertools

lista = [["a", "b", "c"], ["d", "e", "f"]]
listb = [[1, "b", "c"], ["d", "e", "f"]]

def check(temp_plan):
    if all(isinstance(elements, str) for elements in itertools.chain(*temp_plan)):
        return True
    else:
        return False

print(check(lista))
print(check(listb))

```
Here's a version that doesn't care about the internal structure. We can just check each element to see if it is str (return True), iterable (check all of its elements), else return False

```
from typing import Iterable

def check(data):
    if isinstance(data, str):
        return True # recursion base case
    if isinstance(data, Iterable):
        return all(map(check, data))
    return False

if not check('a'):
    raise ValueError
if check(0):
    raise ValueError

lista = [["a", "b", "c"], ["d", "e", "f"]]
listb = [["a", ["b", "c", 0]], [["d", "e"], "f"]]
if not check(lista):
    raise ValueError
if check(listb):
    raise ValueError

print ('passed')

```