def levenshtein_similarity(string1, string2):
 return (1 - (levenshtein(string1, string2) / float(max(len(string1), len(string2), 1.0))))

def levenshtein_similarity ( string1 , string2 ) : return ( 1 - ( levenshtein ( string1 , string2 ) / float ( max ( len ( string1 ) , len ( string2 ) , 1.0 ) ) ) )
returns the similarity of string1 and string2 as a number between 0 .