
def BuildDictionary(D):
    D["WWW"] = "World Wide Web"
    D["SNAFU"]= "Situation Normal, all F***ed UP"
    D["OSCA"] = "Oberlin Student Cooperative Association"
    D["FUBAR"] = "F***ed Up Beyond All Recognition"
    D["LOL"] = "Laughing Out Loud"

def SearchDictionary(D, string):
    if string in D.keys():
        return D[string]
    else:
        return ""

def PrintDictionary(D):
    keyList = D.keys()
    keyList.sort()
    for k in keyList:
        print "%s: %s" %(k, D[k])

def main():
    print "Welcome to Bob's Acronym Dictionary"
    Dict = {}
    BuildDictionary(Dict)

    done = False
    while not done:
        acronym = raw_input("Enter an acronym, or blank to exit: " )
        if acronym == "":
            done = True
        else:
            meaning = SearchDictionary(Dict, acronym)
            if meaning == "":
                print "Not found"
            else:
                print "%s: %s" % (acronym, meaning)

    print "Here are all of the acronyms I know: "
    PrintDictionary(Dict)

main()
