<qiyuangong>067_Add_Binary_1.py
def addBinary( a, b):
    res = ''
    lsa, lsb = len(a), len(b)
    pos = -1
    plus = 0
    while (lsa + pos) >= 0 and (lsb + pos) >= 0:
        curr = int(a[pos]) + int(b[pos]) + plus
        if curr >= 2:
            plus = 1
            curr %= 2
        else:
            plus = 0
        res = str(curr) + res
        pos -= 1
    if lsa + pos >= 0:
        while (lsa + pos) >= 0:
            curr = int(a[pos]) + plus
            if curr >= 2:
                plus = 1
                curr %= 2
            else:
                plus = 0
            res = str(curr) + res
            pos -= 1
    if lsb + pos >= 0:
        while (lsb + pos) >= 0:
            curr = int(b[pos]) + plus
            if curr >= 2:
                plus = 1
                curr %= 2
            else:
                plus = 0
            res = str(curr) + res
            pos -= 1
    if plus == 1:
        res = '1' + res
    return res
def sample_funcname ( var_0 , var_1 ) :
    var_3 = ''
    var_5 , var_6 = len ( var_0 ) , len ( var_1 )
    var_8 = - 1
    var_10 = 0
    while ( var_5 + var_8 ) >= 0 and ( var_6 + var_8 ) >= 0 :
        var_12 = int ( var_0 [ var_8 ] ) + int ( var_1 [ var_8 ] ) + var_10
        if var_12 >= 2 :
            var_10 = 1
            var_12 %= 2
        else :
            var_10 = 0
        var_3 = str ( var_12 ) + var_3
        var_8 -= 1
    if var_5 + var_8 >= 0 :
        while ( var_5 + var_8 ) >= 0 :
            var_12 = int ( var_0 [ var_8 ] ) + var_10
            if var_12 >= 2 :
                var_10 = 1
                var_12 %= 2
            else :
                var_10 = 0
            var_3 = str ( var_12 ) + var_3
            var_8 -= 1
    if var_6 + var_8 >= 0 :
        while ( var_6 + var_8 ) >= 0 :
            var_12 = int ( var_1 [ var_8 ] ) + var_10
            if var_12 >= 2 :
                var_10 = 1
                var_12 %= 2
            else :
                var_10 = 0
            var_3 = str ( var_12 ) + var_3
            var_8 -= 1
    if var_10 == 1 :
        var_3 = '1' + var_3
    return var_3
