counting the no. of substrings in a word in python

This question already has an answer here:


You can try this regex solution:

import re
len(re.findall("((?=ATA))", dna_string))
# 3


 ? Overlapping matches in R
 ? How to plot Pie charts in haploNet Haplotype Networks {pegas}
 ? how to match dna sequence pattern
 ? R- How to plot correct pie charts in haploNet haplotyp Networks {pegas} {ape} {adegenet}
 ? chaos game for DNA sequences
 ? matching and counting strings (k-mer of DNA) in R
 ? Translation DNA to Protein
 ? Fast algorithms for finding unique sets in two very long sequences of text
 ? Improving code design of DNA alignment degapping
 ? Use Python to extract Branch Lengths from Newick Format