この関数は、文字列 z のインデックスである複数の値を出力しますが、それらの値を保存したいので、return を使用すると関数が終了し、いくつかの最初の値のみが残ります。
def find(a):
index=a
while index<len(z)-1:
if z[index]=="T":
for index in range (index+20,index+30):
if z[index]=="A" and z[index+1]=="G" and z[index+2]=="T":
a=index
print a
index=index+1