Sha256: 3fddc291976331bc32691a8feac65cb07c37763b97c9761a3a1dc4111bb25681

Contents?: true

Size: 383 Bytes

Versions: 108

Compression:

Stored size: 383 Bytes

Contents

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))

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.118 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.117 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.116 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.115 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.114 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.113 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.111 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.110 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.109 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.108 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.107 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.106 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.105 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.104 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.103 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.102 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.101 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.100 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.99 tracks/python/exercises/nucleotide-count/example.py