import collections
a = collections.defaultdict(collections.Counter)
inf = [('fruit','apple'),('car','truck'),('fruit','banana'),('fruit','banana')]
for category,item in inf:
a[category][item] = a[category][item] + 1
#print(a)
#{'fruit': Counter({'banana': 2, 'apple': 1}), 'car': Counter({'truck': 1})})
IDs = ['emp1','emp2','emp3']
EmpInfo = [{'name': 'Bob', 'job': 'Mgr'},
{'name': 'Kim', 'job': 'Dev'},
{'name': 'Sam', 'job': 'Dev'}]
D = dict(zip(IDs, EmpInfo))
print(D)
# Prints {'emp1': {'name': 'Bob', 'job': 'Mgr'},
# 'emp2': {'name': 'Kim', 'job': 'Dev'},
# 'emp3': {'name': 'Sam', 'job': 'Dev'}}
D = {'emp1': {'name': 'Bob', 'job': 'Mgr'},
'emp2': {'name': 'Kim', 'job': 'Dev'},
'emp3': {'name': 'Sam', 'job': 'Dev'}}