import difflib


def diff(s1, s2):
    """Compute the difference betweeen two strings normalized by the length
    of the longest of the two strings"""
    longest = max((s1, s2), key=len)
    return sum(d[0] != ' ' for d in difflib.ndiff(s1, s2)) / len(longest)