def levenshtein_distance(word_1, word_2):
    """
    Calculates the levenshtein distance (= the number of letters to add/
    substitute/interchange in order to pass from word_1 to word_2)
    """
    array = [[0 for i in range(len(word_2)+1)] for y in range(len(word_1)+1)]

    for i in range(len(word_1)+1):
        array[i][0] = i
    for j in range(len(word_2)+1):
        array[0][j] = j
    
    for i in range(1, len(word_1)+1):
        for j in range(1, len(word_2)+1):
            cost = 0 if word_1[i-1] == word_2[j-1] else 1
            array[i][j] = min(
                array[i-1][j] + 1,
                array[i][j-1] + 1,
                array[i-1][j-1] + cost
                )

    return array[len(word_1)][len(word_2)]