def get_similarity_score(dict1, dict2, dissimilarity = False):
    """
    The keys of dict1 and dict2 are all lowercase,
    you will NOT need to worry about case sensitivity.

    Args:
        dict1: frequency dictionary of words or n-grams for one text
        dict2: frequency dictionary of words or n-grams for another text
        dissimilarity: Boolean, optional parameter. Default to False.
          If this is True, return the dissimilarity score, 100*(DIFF/ALL), instead.
    Returns:
        int, a percentage between 0 and 100, inclusive
        representing how similar the texts are to each other

        The difference in text frequencies = DIFF sums words
        from these three scenarios:
        * If a word or n-gram occurs in dict1 and dict2 then
          get the difference in frequencies
        * If a word or n-gram occurs only in dict1 then take the
          frequency from dict1
        * If a word or n-gram occurs only in dict2 then take the
          frequency from dict2
         The total frequencies = ALL is calculated by summing
         all frequencies in both dict1 and dict2.
        Return 100*(1-(DIFF/ALL)) rounded to the nearest whole number if dissimilarity
          is False, otherwise returns 100*(DIFF/ALL)
    """
    DIFF = 0
    for i in dict1:
        x = False
        #Boolean used to not add repeated frequencies as it will be seen later
        for j in dict2:
            if i == j:
                #use of == instead of i in j as for example word "meme" could
                #be in "memes" and would therefore cause a problem
                DIFF += abs(dict1[i] - dict2[j])
                #if the word/n-gram appears in both dictionnaires then
                #the absolute value of the difference between the frequencies 
                #in each dictionnary is added to DIFF
                x = True
        if x == False:
            #Boolean used so that frequencies of a word/n-gram are not added again
            #and again to DIFF
            DIFF += dict1[i]   
    for j in dict2:
        x = False
        #same use of boolean for same reasons as previou for loop
        for i in dict1:
            if i == j:
                #use of == due to the same reason
                x = True
                #this time the absolute value of the difference between the
                #frequencies doesn't have to be added as it already has been
        if x == False:
            DIFF += dict2[j]
    ALL = 0
    for i in dict1:
        ALL += dict1[i]
        #all the  frequencies of the first dictionnary are added to ALL
    for j in dict2:
        ALL += dict2[j]
        #same occurs as in the previous loop but for the second dictionnary
        
    #Depending on the input of dissimilarity this will occur
    if dissimilarity == False:
        result = round(100*(1 - (DIFF/ALL)))
        #similarity between the dictionnaries of word/n-grams is the result
    else:
        result = round(100*(DIFF/ALL))
        #dissimilarity between the dictionnaries of word/n-grams is the result
    return result