May-02-2018, 08:41 PM
Hi,
I'm working on a Exercism programming exercise for transcribing DNA into RNA.
My code looks like this:
Unfortunately, this code produces following error and I have no clue why:
What's the reason for this 'NoneType' object?
Regards,
Atalanttore
I'm working on a Exercism programming exercise for transcribing DNA into RNA.
My code looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
def dna_to_rna(dna_strand): dna_rna = { 'G' : 'C' , 'C' : 'G' , 'T' : 'A' , 'A' : 'U' } dna_list = list (dna_strand) rna_list = [] for dna in dna_list: rna_list = rna_list.append(dna_rna[dna]) return rna_list dna_to_rna( 'ATCGGTTA' ) # Test function |
1 |
AttributeError: 'NoneType' object has no attribute 'append' |
Regards,
Atalanttore