def freq(code):
    """
    return a dic with the number of occurence of each char of the text given
    in : code (str/list) > text from wich you want to extract frequency
    out : dic (dic) > dic with the number of occurence of each char of the text given
    >>>freq("eeebaaa")
    {"e" : 3, "b" : 1, "a": 3}
    """
    dic = {"e": 0 } #initialise dic so it is not empty
    for i in range(len(code)):
        if code[i] not in dic:
            dic[code[i]] = 1
        else:
            dic[code[i]] += 1
    return dic