The question provides a big string and a substring. And what I have to do is to write a code that can look for the substring from the big string, and output the .start() positions of the substrings found. For example: Sample Dataset GATATATGCATATACTT ATAT Sample Output 2 4 10
So I have written a code (shown below), however, I noticed that the code would skip position 4 in the sample data set because half of position 4 is in 2?
Please show me how I can solve this problem. Thanks sooooo much in advance!!!
import re
filename = open(input())
txt=filename.readline()
rlist=[]
text= "ATAT"
for m in re.finditer (text, txt):
d = m.start()
d += 1
rlist.append(d)
print (rlist)