Minsu Kim/python/Rosalind / problem7
From Biolecture.org
Revision as of 21:21, 12 December 2017 by imported>Minsukim (Created page with "<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202017-12-12%2021-04-47-342.jpg" style="height:293px; width:1100px" /></p> <p> </p> <p>f = open('rosalind_ba1h....")
f = open('rosalind_ba1h.txt', 'r')
lines = f.readlines()
f.close()
pattern = lines[0].strip()
seq = lines[1].strip()
d = int(lines[2])
solution = open('solution.txt','w')
for i in range(len(seq)-len(pattern)+1):
count = 0
for j in range(len(pattern)):
if seq[i+j]!=pattern[j]:
count += 1
if count <= d:
solution.write(str(i))
solution.write("\n")
solution.close