def similarity(string1, string2, metric=LEVENSHTEIN):
 if (metric == LEVENSHTEIN):
  return levenshtein_similarity(string1, string2)
 if (metric == DICE):
  return dice_coefficient(string1, string2)

def similarity ( string1 , string2 , metric = LEVENSHTEIN ) : if ( metric == LEVENSHTEIN ) : return levenshtein_similarity ( string1 , string2 ) if ( metric == DICE ) : return dice_coefficient ( string1 , string2 )
returns the similarity of string1 and string2 as a number between 0 .