Using Python 2.7, I was attempting to count the number of occurances of \'bob\' in the phrase \'bobbbobobboobobookobobbobbboj.\' To do this, I wrote the code below:
If you want to do it the Pythonic way, then you'll want to read up on the string find function.
If you want to learn how make a string find function, then you'll want to read up on string searching algorithms.