Sha256: 4a36059e34540dc789bab33a83e5cd1a2f18e79cf0da5c56926423a414d91999

Contents?: true

Size: 377 Bytes

Versions: 288

Compression:

Stored size: 377 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('%s is not a nucleotide.' % abbreviation)

Version data entries

288 entries across 288 versions & 1 rubygems

Version Path
trackler-2.2.1.70 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.69 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.68 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.67 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.66 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.65 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.64 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.63 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.62 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.61 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.60 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.59 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.58 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.57 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.56 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.55 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.54 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.53 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.52 tracks/python/exercises/nucleotide-count/example.py
trackler-2.2.1.51 tracks/python/exercises/nucleotide-count/example.py