I have two lists:
eg. a = [1,8,3,9,4,9,3,8,1,2,3] and b = [1,8,1,3,9,4,9,3,8,1,2,3]
Both contain ints. There is no meaning behind the ints (eg. 1 is not \'cl
You can use the difflib module
ratio() Return a measure of the sequences’ similarity as a float in the range [0, 1].
Which gives :
>>> s1=[1,8,3,9,4,9,3,8,1,2,3] >>> s2=[1,8,1,3,9,4,9,3,8,1,2,3] >>> sm=difflib.SequenceMatcher(None,s1,s2) >>> sm.ratio() 0.9565217391304348