This function map input strings to that in a dictionary, outputting the result. Any idea how this can be approached recursively?
def dna(seq):
hashtable = {'A': 'U', 'G': 'C', 'T': 'A', 'C': 'G'}
ans = ''
for i in range(len(seq)):
ans += hashtable[seq[i]]
return ans
print(dna('AGCTGACGTA'))
Thanks.