Counting Nucleotides

Foundational DNA Strings Counting
Significance:
Every downstream tool in genomics — from base-calling QC to variant callers — starts with the same primitive: knowing the base composition of a sequence. Nucleotide counting is also the first check a bioinformatician runs to sanity-test a FASTA file (e.g., "does this look like a real genome or is it corrupted/N-heavy?"). It's the "Hello World" of computational biology for a reason: it forces you to think about strings as biological objects, not just characters.
Statement

Given a single-stranded DNA sequence composed only of the characters `A`, `C`, `G`, and `T`, count how many times each nucleotide occurs. This is a direct analog of the base-composition statistics reported by every sequencing QC tool (FastQC, Biopython's `SeqUtils`, etc.).

Your program should read one DNA string and output four integers, space-separated, in the fixed order **A C G T**.

Sample Input
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
Sample Output
20 12 17 21
Constraints

- `1 ≤ length(DNA) ≤ 1000`
- String contains only uppercase `A`, `C`, `G`, `T` (no `N`, no lowercase, no whitespace inside the sequence)

You can use the built-in count() method of strings in Python.


My Notes
Log in to save personal notes.
Console output will appear here when you click Run Code or Submit...
Enter DNA / RNA / Protein test string
Next Problem
DNA to RNA Transcription