def get_indices_from_the_second_string(string1, string2): \'\'\'(str, str) -> list of int >>> get_indices_from_the_second_string(\'AGTACACGTTAC\', \'
Use the built in function zip, along with another built in enumerate
zip
enumerate
acc = [] for i, (a, b) in enumerate(zip(string1, string2)): if a==b: acc.append(i) return acc