def best_match(a, b):
    max = 0
max_score = 0
for offset in range(len(a)):
    val = score(a[offset:], b)
if val > max_score:
    max_score = val
max = offset
return max
Грубое выравнивание строк в python