<qiyuangong>091_Decode_Ways_1.py
def numDecodings( s):
    ls = len(s)
    if ls == 0:
        return 0
    dp = [0] * ls
    for index in range(ls):
        if index >= 1 and int(s[index - 1:index + 1]) < 27 and int(s[index - 1:index + 1]) >= 10:
            if index == 1:
                dp[index] = 1
            else:
                dp[index] += dp[index - 2]
        if int(s[index]) != 0:
            if index == 0:
                dp[index] = 1
            else:
                dp[index] += dp[index - 1]
    return dp[ls - 1]
def sample_funcname ( var_0 ) :
    var_2 = len ( var_0 )
    if var_2 == 0 :
        return 0
    var_4 = [ 0 ] * var_2
    for var_6 in range ( var_2 ) :
        if var_6 >= 1 and int ( var_0 [ var_6 - 1 : var_6 + 1 ] ) < 27 and int ( var_0 [ var_6 - 1 : var_6 + 1 ] ) >= 10 :
            if var_6 == 1 :
                var_4 [ var_6 ] = 1
            else :
                var_4 [ var_6 ] += var_4 [ var_6 - 2 ]
        if int ( var_0 [ var_6 ] ) != 0 :
            if var_6 == 0 :
                var_4 [ var_6 ] = 1
            else :
                var_4 [ var_6 ] += var_4 [ var_6 - 1 ]
    return var_4 [ var_2 - 1 ]
