Assume I have this list of dictionaries:
c = [
{"name": "Tom", "age": 10, "tag": "kid"},
{"name": "Mark", "age": 35, "tag": "adult" },
{"name": "Pam", "age": 70, "tag": "very old"},
{"name": "Neo", "age": 16, "tag": "teenager"},
{"name": "Anna", "age": 9, "tag": "kid"}
]
I want to write a function that iterates the list c (and returns a dictionary) to get how many times the value of tag occurs in the list of dictionaries. In this case it should return a dictionary like this:
f = {"kid": 2, "adult": 1, "very old": 1, "teenager": 1}
How to achieve this?