> In information theory and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other.
(http://en.wikipedia.org/wiki/Levenshtein_distance)
Your task is to implement a function which calculates the Levenshtein distance for two arbitrary strings.
def levenshtein(a,b):
    def recurse(i, j):
        if i >= len(a) or j >= len(b):
            return abs(i - len(a)) + abs(j - len(b))
        if a[i] == b[j]:
            return recurse(i+1, j + 1)
        else:
            return 1 + min(recurse(i + 1, j), recurse(i, j + 1), recurse(i + 1, j + 1))
    return recurse(0,0)
def levenshtein(a,b):
    def recurse(i, j):
        if i >= len(a) or j >= len(b):
            return abs(i - len(a)) + abs(j - len(b))
        if a[i] == b[j]:
            return recurse(i+1, j + 1)
        else:
            return 1 + min(recurse(i + 1, j), recurse(i, j + 1), recurse(i + 1, j + 1))
    return recurse(0,0)