l1 = "GATATATGCATATACTT"
l2 = "ATAT"
for i in range(len(l1)):
if l1[i] == "A" and l1[i+1] == "T" and l1[i+2] == "A" and l1[i+3] == "T":
print (i+1)
L1 is the main seq L2 is the sub sequence that I am trying to find in L1. The above code does give me the correct output (2,4,10) but is there a better way ? I am new to coding and am thinking if I have a larger sequence, this might not be efficient. Thanks!