RosettaCodeData/Task/Count-occurrences-of-a-substring/Python/count-occurrences-of-a-substring.py
2023-07-01 13:44:08 -04:00

4 lines
70 B
Python

>>> "the three truths".count("th")
3
>>> "ababababab".count("abab")
2