Count substring in string
Using this kind of all-top-level short-named fully imperative style forces you to rely heavily on comments to make the code readable.

Comments everywhere repeating the code violate the DRY principle:

    # increasing the Bob count
    numBob += 1


You just doubled reading / maintaining time here.

Descriptive names, examples of usage and sometimes functional style make "how"-kind comments unnecessary:

def count(substring, string):
    """
    &gt;&gt;&gt; count("bob","bobhejrhaabobfqbqsanbobb")
    3
    """
    return sum(substring == group for group in groups(string, len(substring)))

def groups(xs, n):
    """
    &gt;&gt;&gt; groups([1, 2, 3, 4, 5], 3)
    [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
    """
    for i in range(len(xs)-n):
        yield xs[i:i+n]


The code looks self explaining to me, but feel free to ask about any doubts about it.