This for c in seqreader:
will iterate once for every letter in the txt file. That is over 6700 times for 18.txt! And program doesn't use c
in that loop. That looks like the problem.
NB If you edit the question, select the code and click the {}
icon in the format bar, it will format the code so it is legible.