Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python similar strings

from difflib import SequenceMatcher

def similar(a, b):
    return SequenceMatcher(None, a, b).ratio()
Using it:

>>> similar("Apple","Appel")
0.8
>>> similar("Apple","Mango")
0.0
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #similar #strings
ADD COMMENT
Topic
Name
6+4 =