I am sorry that I am not sure my question is correct or clear enough. However, I hope the example below can explain my question:
As what you see
print("abbbbbbc".count("bbb")) #–output is 2
But I want the result is 4, because bbbbbb has 6 characters and can breakdown as below:
bbb---
-bbb--
--bbb-
---bbb
I couldn't figure out which function I can use to solve this matter. What I did is count by for combinations, and it doesn't look right at all.
Thank for helping.