I have file that is list of JSON objects. It looks like this : 

```
[
  {
    "id": 748,
    "location": {
      "slug": "istanbul",
      "parent": {
        "id": 442,
        "slug": "turkey"
      }
    },
    "rank": 110
  },
  {
    "id": 769,
    "location": {
      "slug": "dubai",
      "parent": {
        "id": 473,
        "slug": "uae"
      }
    },
    "rank": 24
  }
]

```

I want to create a list of hotel parent names, so i write this code to do this, I read the JSON file and assigned it to a variable, that part is correct. But look at this code : 

```
with open('hotels.json', 'r', encoding="utf8") as hotels_data:
    hotels = json.load(hotels_data)

parents_list = []
for item in hotels:
    if item["location"]["parent"]["slug"] not in parents_list:
        parents_list.append(item["location"]["parent"])

```

when i run this code, i give this error : 

```
if item["location"]["parent"]["slug"] not in parents_list:
TypeError: 'NoneType' object is not subscriptable

```

This code does not work, so I tried to print the JSON objects so I wrote this in the loop:

```
print(item["location"]["parent"]["slug"])

```

This code prints the values I want, but also give me the exact same error. 
thank you for any help.