I want to take two lists with dict value and find the specific values that appear only in first list.
In this case, only compare 'name' key.
a = [
{'name': 'joseph', 'age': 33},
{'name': 'Emma', 'age': 11},
{'name': 'apple', 'age': 44}
]
b = [
{'name': 'apple', 'age': 44},
{'name': 'Emma', 'age': 22}
]
returnOnlyOne(a, b)
would return [{'name': 'joseph', 'age': 33}], for instance.
The set() solution is not for this case.