Использование простой итерации
Пример:
list1 = ['fq','ab','opn','ef','cd','ef','opn','kl','fq','str','opn','ab','cd']
list2 = ['ab','cd','ef','ed','fq']
check_val = {} #--> {'fq': [0, 8], 'ab': [1, 11], 'opn': [2, 6, 10], 'ef': [3, 5], 'cd': [4, 12], 'kl': [7], 'str': [9]}
for idx, val in enumerate(list1):
check_val.setdefault(val, []).append(idx)
found_item_index = [check_val.get(i, [None]) for i in list2]
print(found_item_index)
Вывод:
[[1, 11], [4, 12], [3, 5], [None], [0, 8]]