So I have this list:

```
list = ["NYC Football", ["NY Giants","NY Jets"], "NYC Hockey", ["NY Rangers", "NY Islanders", "NJ Devils"]]

```

How would I loop through this list and only print out:

```
NY Giants
NY Jets
NY Rangers
NY Islanders
NJ Devils

```
['https://Stackoverflow.com/questions/35507451', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
You could use the following:

```
my_list = ["NYC Football", ["NY Giants","NY Jets"], "NYC Hockey", ["NY Rangers", "NY Islanders", "NJ Devils"]]

for item in my_list:
    if type(item) == list:
        for i in item:
            print(i)

```

**Output**

```
NY Giants
NY Jets
NY Rangers
NY Islanders
NJ Devils

```

**Aside:** you shouldn't use the keyword `list` as a variable name. In my example I have altered it to `my_list`.
Loop over the outer list, and only if the item is a list, iterate over it and print its items:

```
for thing in my_list: #don't call it "list"
    if isinstance(thing, list):
        for other in thing:
            print(other)

```

Another way:

```
for thing in filter(lambda x: isinstance(x, list)):
    for other in thing:
        print(other)

```