Question: I've got two lists of dictionaries as below:

```
string1 =[
  {"name": "Tom", "age": 10},
  {"name": "Mark", "age": 5},
  {"name": "Pam", "age": 7},
  {"name": "Weranika", "age": 18}
]
string2 =[  {"name": "Tom", "age": 8},
  {"name": "Mark", "age": 5},
  {"name": "Pam", "age": 7}
]

```

And I want to print key/value for item which doesn't exists in the second list of dictionary.

In my case output should return:

```
{"name": "Weranika", "age": 18}

```

Answer: 
You can iterate over the dictionaries in `string1` and check if a name in it exists in the set of names in `string2`:

```
names = set(d['name'] for d in string2)
not_in_string2 = [dct for dct in string1 if dct['name'] not in names]

```

Output:

```
{'name': 'Weranika', 'age': 18}

```
```
str1  = [i["name"] for i in string1]

```

get name in the string

```
str2  = [i["name"] for i in string2]

```

name not in string2 but in 1

```
not_in_string_2 = list(set(str1) ^ set(str2))

```

index of the value not in sring2

```
index = []
for x,i in enumerate(string1):
    if i["name"] in not_in_string_2:
        index.append(x)
for i in index:
   print(string1[i])

```

print the result