move practice exercise example solutions to .meta/

This commit is contained in:
Corey McCandless
2021-01-31 16:06:16 -05:00
committed by BethanyG
parent 2bb2d08be0
commit d7e8e0c736
131 changed files with 167 additions and 90 deletions

View File

@@ -0,0 +1,18 @@
NUCLEOTIDES = 'ATCG'
def count(strand, abbreviation):
_validate(abbreviation)
return strand.count(abbreviation)
def nucleotide_counts(strand):
return {
abbr: strand.count(abbr)
for abbr in NUCLEOTIDES
}
def _validate(abbreviation):
if abbreviation not in NUCLEOTIDES:
raise ValueError('{} is not a nucleotide.'.format(abbreviation))