Module 4

count()

Counting occurrences of a substring.

Counting occurrences

The count() method returns how many times a substring appears in a string.

Python
seq = "ATGCGCA"
print(seq.count("A"))
print(seq.count("GC"))
2 2
Your task

Count occurrences

  • Count how many times A appears in ATGCGCA.