<doocs>0028.Find the Index of the First Occurrence in a String_1.py
def strStr( haystack, needle):
    for i in range(len(haystack) - len(needle) + 1):
        p = i
        q = 0
        while p < len(haystack) and q < len(needle) and haystack[p] == needle[q]:
            p += 1
            q += 1
    
        if q == len(needle):
            return i
    
    return -1
def sample_funcname ( var_0 , var_1 ) :
    for var_5 in range ( len ( var_0 ) - len ( var_1 ) + 1 ) :
        var_6 = var_5
        var_8 = 0
        while var_6 < len ( var_0 ) and var_8 < len ( var_1 ) and var_0 [ var_6 ] == var_1 [ var_8 ] :
            var_6 += 1
            var_8 += 1
        if var_8 == len ( var_1 ) :
            return var_5
    return - 1
