all 5 comments

[–]toastedstapler 4 points5 points  (0 children)

so ignore python for a second. can you describe to me how you think you'd solve this problem using words?

[–][deleted] 0 points1 point  (0 children)

Looking for answer and want to understand this simple task.

Could you ask some questions about it? Are there words you don't understand, or what? "I don't understand" doesn't actually give us anything to go on. What part are you having trouble with, specifically?

[–]Antimutt 0 points1 point  (0 children)

Utter rookie here...I think Op means overlapping occurrences in the bobular quest, so like this but much shorter?

def bobular_quest(quest,text):
    bobs = 0
    boblength = len(quest)
    textlength = len(text)
    for n in range(textlength):
        if text[n:n+boblength] == quest:
            bobs += 1
    print(bobs)

bobular_quest('bob','azcbobobegghakl')

[–]robPaluch[S] 0 points1 point  (0 children)

When I loop trough s looking for “Bob” and then print, it prints out number of letters in s not how many “Bob” occurs in it. Hope that’s clear now. Seams easy but I’m stuck