Say I have string = \'hannahannahskdjhannahannah\' and I want to count the number of times the string hannah occurs, I can\'t simply use count, bec
string = \'hannahannahskdjhannahannah\'
hannah
If you want to count also nonconsecutive substrings, this is the way to do it
def subword(lookup,whole): if len(whole)