You forgot the first parameter to SequenceMatcher.
>>> import difflib
>>>
>>> a="abcd"
>>> b='ab123'
>>> seq=difflib.SequenceMatcher(None, a,b)
>>> d=seq.ratio()*100
>>> print d
44.4444444444
http://docs.python.org/library/difflib.html
You forgot the first parameter to SequenceMatcher.
>>> import difflib
>>>
>>> a="abcd"
>>> b='ab123'
>>> seq=difflib.SequenceMatcher(None, a,b)
>>> d=seq.ratio()*100
>>> print d
44.4444444444
http://docs.python.org/library/difflib.html