I just had this working, and now, for the life of me, I cannot get the loop to continue, as it only produces the outcome of the first input. Where did I go wrong? I know im an amateur, but whatever help you might have would be awesome! Thanks.
sequence = open('sequence.txt').read().replace('\n','')
enzymes = {}
fh = open('enzymes.txt')
print('Restriction Enzyme Counter')
inez = input('Enter a Restricting Enzyme: ')
def servx():
for line in fh:
(name, site, junk, junk) = line.split()
enzymes[name] = site
if inez in fh:
xcr = site
print('Active Bases:', site)
for line in sequence.split():
if xcr in line:
bs = (sequence.count(xcr))
print('Enzyme', inez, 'appears', bs, 'times in Sequence.')
servx()
def servy():
fh.seek(0);
qust = input('Find another Enzyme? [Yes/No]: ')
if qust == 'Yes':
inez = input('Enter a Restricting Enzyme: ')
servx()
servy()
elif qust == 'No':
print('Thanks!')
elif qust != 'Yes''No':
print('Error, Unknown Command')
servy()
fh.close()