Você precisa primeiro definir coding_seq
genomic = open("genomic_dna.txt").read()
exons = open("exons.txt")
coding_seq = ""
for line in exons:
positions = line.split(',')
start = int(positions[0])
stop = int(positions[1])
exons = genomic[start:stop]
coding_seq = coding_seq + exon
print("Coding sequence is: " + coding_seq)