words = ["a", "b", "c", "d", "a", "b", "a", "d", "a", "c", "c", "d", "a", "c", "c", "c"]

# print words

freq={} # dict
for word in words:

    if word in freq:
        freq[word] += 1 # if dictionary contains the key then increment the value
        # print "word in freq",freq
    else:
        freq[word] = 1 # if not add the key ( word ) and value is 1
        # print "word not in freq",freq

print freq
'''
O/P for words = ["a", "b", "c", "d", "a", "b", "a", "d", "a", "c", "c", "d", "a", "c", "c", "c"]
{'a': 5, 'c': 6, 'b': 2, 'd': 3}
'''
