This was my attempt , I wanted to take a window of 3 letters and walk through the string, But not getting the expected answer of 2 . I am getting into some infinite loop. Wondering why .
def find_bob(s1):
check_list = 'bob'
count = 0
n=0
cmp_chars=0
while n<=len(s1):
while cmp_chars == s1[n:3]:
if cmp_chars == check_list:
count += 1
continue
return count
s1= 'azcbobobegghakl'
#check_list='bob'
val1 = find_bob(s1)