This code works, but reading posts on here I get the impression it is probably not a very \"Pythonic\" solution. Is there a better more efficient way to solve this specific
Why not use the count method of str?
count
str
>>> a = "abcghabchjlababc" >>> a.count("abc") 3