<qiyuangong>028_Implement_strStr()_1.py
def strStr( haystack, needle):
    lsh, lsn = len(haystack), len(needle)
    if lsn == 0:
        return 0
    pos, index = 0, 0
    while index <= lsh - lsn:
        if haystack[index] == needle[pos]:
            backup = index
            while index < lsh and pos < lsn and haystack[index] == needle[pos]:
                pos += 1
                index += 1
            if pos == len(needle):
                return index - pos
            index = backup
        index += 1
        pos = 0
    return -1
def sample_funcname ( var_0 , var_1 ) :
    var_3 , var_4 = len ( var_0 ) , len ( var_1 )
    if var_4 == 0 :
        return 0
    var_6 , var_7 = 0 , 0
    while var_7 <= var_3 - var_4 :
        if var_0 [ var_7 ] == var_1 [ var_6 ] :
            var_8 = var_7
            while var_7 < var_3 and var_6 < var_4 and var_0 [ var_7 ] == var_1 [ var_6 ] :
                var_6 += 1
                var_7 += 1
            if var_6 == len ( var_1 ) :
                return var_7 - var_6
            var_7 = var_8
        var_7 += 1
        var_6 = 0
    return - 1
