# https://stackoverflow.com/questions/49512206/loosing-element-value-when-looping-python-list

from difflib import SequenceMatcher

def similar(a, b):
    s = SequenceMatcher(a, b).ratio()
    s = round(s * 100, 1)
    return s


list1=['aaaa','cccc','bb']
list2=['aaa','fff','v']

for word1 in list1:
    for word2 in list2:
        result = similar(word1, word2)
        print('Comparing "{}" and "{}", got {}'.format(
        	word1, word2, result))
        if similar(word1, word2) > 0:
            print(word2)

print('Loop finished, contents of lists:')
print('list1: {}'.format(repr(list1)))
print('list2: {}'.format(repr(list2)))