查找核酸序列的子集 http://rosalind.info/problems/subs/ 1 2 3 4 5 6 7 8 9 10 11 12 with open('rosalind_subs.txt') as lines: string_1 = lines.readline().strip() string_2 = lines.readline().strip() note = [] length_2 = len(string_2) for i in range(0, len(string_1)+1): if string_1[i:i+length_2] == string_2: note.append(str(i+1)) notes = ' '.join(note) print(notes) 计算两条序列间的汉明距离 http://rosalind.info/problems/hamm/ 1 2 3 4