📜  python 类似字符串 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.853000             🧑  作者: Mango

代码示例1
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