'''
Created on Nov 7, 2017

@author: Susan
'''
def freqs(data):
    d = {}
    for word in data:
        cnt = 0
        for word2 in data:
            if word == word2:
                cnt += 1
        d[word] = cnt
    print d
    
def freqs2(data):
    d = {}
    for word in data:
        cnt = data.count(word)
        d[word] = cnt
    print d

    
def freqs3(data):
    d = {}
    for word in data:
        if word not in d:
            d[word] = 0
        d[word] += 1
    print d
    
    
if __name__ == '__main__':
    # make big list
    words = ("apple pear cherry apple cherry pear apple banana "*3000)[:-1]
    words = words.split()
    print "start with freqs"
    freqs(words)
    print "Done with freqs"
    print "start with freqs2"
    freqs2(words)
    print "Done with freqs2"
    print "start with freqs3"
    freqs3(words)
    print "Done with freqs3"