Profile the fragment
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:
- The number of
A,C,GandTbases, in that order, separated by single spaces. - The GC content: the percentage of bases that are
GorC, 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
Check your understanding
A quick self-check, marked right here in your browser. It is not graded or saved.
In double-stranded DNA, which base pairs with adenine (A)?
A pairs with T in DNA (and with U in RNA); G pairs with C.
Why do biologists care about a region's GC content?
GC content varies between organisms and along a genome, and it affects how tightly the two strands bind.
Explain and submit
Explain how you counted the bases and how you turned the counts into a GC percentage.
Your submissions (0)
You can look ahead; come back to finish this stage.