# string = 'wowhatamanwowowpalehche'
# substring = 'wow'
# print(string.count(substring))

# def count(string,substring):
#    result = 0
#    i = 0
#    while i > -1:
#        try:
#            i = string.index(substring, i) + len(substring)
#            result += 1
#            i -= 1
#        except:
#            i = -1
#
#    return result
#
#
# string = "wowhatamanwowowpalehche"
# substring = "wow"
# print (count(string,substring))

def count(string, substring):
    result = 0
    i =0
    while i < len(string):
        if string[i:i+len(substring)] == substring:
            result += 1
        i += 1

    return result



string = "wowhatamanwowowpalehche"
substring = "wow"
print (count(string,substring))












1435cead8b749c846079840489582918d56c5856
<mask token>

def count(string, substring):
    result = 0
    i = 0
    while i < len(string):
        if string[i:i + len(substring)] == substring:
            result += 1
        i += 1
    return result


<mask token>

def count(string, substring):
    result = 0
    i = 0
    while i < len(string):
        if string[i:i + len(substring)] == substring:
            result += 1
        i += 1
    return result


<mask token>
print(count(string, substring))

def count(string, substring):
    result = 0
    i = 0
    while i < len(string):
        if string[i:i + len(substring)] == substring:
            result += 1
        i += 1
    return result


string = 'wowhatamanwowowpalehche'
substring = 'wow'
print(count(string, substring))

# string = 'wowhatamanwowowpalehche'
# substring = 'wow'
# print(string.count(substring))

# def count(string,substring):
#    result = 0
#    i = 0
#    while i > -1:
#        try:
#            i = string.index(substring, i) + len(substring)
#            result += 1
#            i -= 1
#        except:
#            i = -1
#
#    return result
#
#
# string = "wowhatamanwowowpalehche"
# substring = "wow"
# print (count(string,substring))

def count(string, substring):
    result = 0
    i =0
    while i < len(string):
        if string[i:i+len(substring)] == substring:
            result += 1
        i += 1

    return result



string = "wowhatamanwowowpalehche"
substring = "wow"
print (count(string,substring))











