create the dictionary of all elements of list with their count code example
Example: convert list of values to dictionary based on count
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1