Try using:
d = {i['service']: i['price'] for i in a}
print([{'service': i, 'price': d.get(i)} for i in b])
Output:
[{'service': 'basketball', 'price': None}, {'service': 'yoga', 'price': 30}, {'service': 'soccer', 'price': None}, {'service': 'golf', 'price': 40}]
0
solved Compare in Python two lists and create a new one that is combinated [closed]