Module 8
Counting A/T/G/C
Tallying each base in a sequence.
Base composition
You can count how many times each base appears using the count() method.
Python
seq = "ATGCGCA"
print(seq.count("A"))
print(seq.count("T"))
print(seq.count("G"))
print(seq.count("C"))→ 2
1
2
2
Your task
Count each base
- Count A, T, G, C in ATGCGCA and print each.