Question
Exercise #4: DNA is made up from 4 different bases (nucleotides), adenine (A), thymine (T), guanine (G) and cytosine (C). This is true for plants,
Exercise #4:
DNA is made up from 4 different bases (nucleotides), adenine (A), thymine (T), guanine (G) and cytosine (C). This is true for plants, animals, bacteria, in fact it is true all life forms on earth that contain DNA.
In an incredible molecular feat called transcription, your cells create molecules of messenger RNA that mirror the sequence of nucleotides in your DNA. The RNA then creates proteins that do the work of the cell.
Create a function called dna_to_rna, which should take as input a string which will have DNA nucleotides (capital letter As, Cs, Gs, and Ts). There may be other characters, too; they should be ignored by your transcribe function and disappear from the output. These might be spaces or other characters that are not DNA nucleotides.
Then, dna_to_rna should output the messenger RNA that would be produced from that DNA string. The correct output simply uses replacement:
As in the input become Us in the output. ? Cs in the input become Gs in the output.
Gs in the input become Cs in the output.
Ts in the input become As in the output.
any other input characters should disappear from the output altogether
Not quite working? One common problem that can arise is that dna_to_rna needs to have an ELSE to capture all of the non-legal characters. All non-nucleotide characters should be dropped.
Here are the tests to check:
ACGTTGCA should be transformed into UGCAACGU
ACG TGCA should be transformed into UGCACGU // note that the space disappears
GATTACA should be transformed into CUAAUGU
A42% should be transformed into U
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started