How do I count number of occurrences in a list and store the word and count value as a dict using python without using Counter function from collection library?
E.g.: list = [a,a,a,b,b,c,c,c,c]
result should be when I print dict a->3 b->2 c->4:
dict=[(word,list.count(word)) for word in list]
This doesn't seem to work.