Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: counting DNA bases

Write a script called count_dna_bases.py that given a sequence like this: "ACTNGTGCTYGATRGTAGCYXGTN", will print out the distribution of the elemnts to get the following result:

A 3 - 12.50 %
C 3 - 12.50 %
G 6 - 25.00 %
N 2 -  8.33 %
R 1 -  4.17 %
T 6 - 25.00 %
X 1 -  4.17 %
Y 2 -  8.33 %