Day 68/100: Reading / Exercism

Did a quick play around with Exercism and some reading.

Here's my solution for RNA Transcription in Python:

def to_rna(dna):
    dna_rna_trans = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}
    rna_strand = []
    dna_list = list(dna)
    for dna_nucleotide in dna_list:
        if dna_nucleotide not in dna_rna_trans:
            return ''
        else:
            rna_strand.append(dna_rna_trans[dna_nucleotide])

    return ''.join(rna_strand)

Comments !

links

social