DNA to Protein Toolkit
0 of 4 stages done
  1. 1 Profile the fragment
  2. 2 Transcribe and mirror
  3. 3 Translate to protein
  4. 4 Weigh the protein
STAGE 3 OF 4

Translate to protein

Code not passed yet Explanation needed Self-check
You are browsing as a guest: read the stage and run code freely. To be graded and save your progress, sign in or create an account →

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

.ipynb
Shift + Enter runs a cell. Your notebook runs and is saved in this browser only; nothing is sent to us until you submit in step 3.

Check your understanding

A quick self-check, marked right here in your browser. It is not graded or saved.

1.

How many bases make up one codon?

2.

What does a stop codon do?

3.

Why is AUG special?

Explain and submit

Explain how your loop moves through the RNA and how it knows when to stop.

Submitting sends the code in your solution cell and this explanation. The code is checked on our server against the given input and hidden tests. The stage is complete when the code passes and the explanation has at least 20 words.

You can look ahead; come back to finish this stage.