Translate to protein
THE BRIEF
Now the key step: translation. A ribosome reads RNA three bases at a time. Each triplet, a codon, stands for one amino acid, and a stop codon ends the protein. The genetic code is a lookup table of 64 codons, which the starter code builds for you (a stop codon is written as *).
Your task. You are given an RNA message that begins with the start codon AUG. Read it codon by codon from the first base, translate each codon with the table, and stop at the first stop codon (do not include the stop in your output).
Input. One line: an RNA string whose length is a multiple of 3 and which contains a stop codon.
Output. One line: the protein as a string of one-letter amino acid codes.
GIVEN INPUT
Your code reads this from standard input (input() or sys.stdin), both here and when it is graded.
AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA
EXPECTED OUTPUT FOR THIS INPUT
MAMAPRTEINSTRING
SKILLS YOU'LL USE
Stuck? These bank problems practise the same techniques.
Write your code
Check your understanding
A quick self-check, marked right here in your browser. It is not graded or saved.
How many bases make up one codon?
Each codon is a triplet of bases that specifies one amino acid (or a stop signal).
What does a stop codon do?
UAA, UAG and UGA do not code for an amino acid; they release the finished protein.
Why is AUG special?
Most proteins begin with methionine because translation normally starts at AUG.
Explain and submit
Explain how your loop moves through the RNA and how it knows when to stop.
Your submissions (0)
You can look ahead; come back to finish this stage.