Skip to content

Instantly share code, notes, and snippets.

@is1394
Created October 11, 2018 20:49
Show Gist options
  • Save is1394/43f48643614eebdc826cfa1f54c2f224 to your computer and use it in GitHub Desktop.
Save is1394/43f48643614eebdc826cfa1f54c2f224 to your computer and use it in GitHub Desktop.
Similar strings
import difflib
string_1 = "hola"
string_2 = "holita"
sequence = difflib.SequenceMatcher(isjunk=None, a=string_1, b=string_2)
difference = sequence.ratio()*100
difference = round(difference, 1)
print("Match {} %".format(difference))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment