'''
Created on Nov 2, 2014

@author: rodger
'''

def createDictionary(songmap, songs):
    #todo
    print
    for item in songs: 
        alist = item.split(":")
        # first choice song
        if alist[0] not in songmap:
            songmap[alist[0]] = [1,0,0]
        else:
            songmap[alist[0]][0] += 1
        #second choice song
        if alist[1] not in songmap:
            songmap[alist[1]] = [0,1,0]
        else:
            songmap[alist[1]][1] += 1
        # third choice song
        if alist[2] not in songmap:
            songmap[alist[2]] = [0,0,1]
        else:
            songmap[alist[2]][2] += 1






            
#problem
songs = ["Hey Jude:Let it be:Day Tripper",
"Let it be:Drive my car:Hey Jude",
"I want to hold your hand:Day Tripper:Help!",
"Born to run:Thunder road:She's the one",
"Hungry heart:The river:Born to run",
"The river:Thunder road:Drive my car", 
"Angie:Start me up:Ruby Tuesday",
"Born to run:Angie:Drive my car"]

print songs
songmap = {}
createDictionary(songmap, songs)
print songmap

