#test 1 question 1 START = 'atg' END1 = 'taa' END2 = 'tag' END3 = 'tga' def sortf(a,b,c): if(a>b): temp=a a=b b=temp if(b>c): temp=b b=c c=temp if(a>b): temp=a a=b b=temp return a, b, c def main(): dna = input("enter dna seq ") start_i = dna.find(START) print("start ", start_i) e1 = dna.find(END1, start_i+1) e2 = dna.find(END2, start_i+1) e3 = dna.find(END3, start_i+1) print("end1 end2 end3 ", e1, e2, e3) e1, e2, e3 = sortf(e1, e2, e3) if(e1!=-1): end_i = e1 orf=dna[start_i: e1] elif(e2!=-1): end_i = e2 orf = dna[start_i: e2] else: end_i = e3 orf=dna[start_i:e3] print("END ", end_i) print("ORF ", orf) main()