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 1 OF 4

Profile the fragment

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

Before doing anything clever with a sequence you describe it. You are given one DNA fragment made of the letters A, C, G and T.

Your task. Print two lines:

  1. The number of A, C, G and T bases, in that order, separated by single spaces.
  2. The GC content: the percentage of bases that are G or C, rounded to two decimal places.

Input. One line: the DNA fragment.

Output. Two lines, as described above.

GIVEN INPUT

Your code reads this from standard input (input() or sys.stdin), both here and when it is graded.

AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC

EXPECTED OUTPUT FOR THIS INPUT

20 12 17 21
41.43

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.

In double-stranded DNA, which base pairs with adenine (A)?

2.

Why do biologists care about a region's GC content?

Explain and submit

Explain how you counted the bases and how you turned the counts into a GC percentage.

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.