list_one = [1, 1, 1, 1, 1, 0]


def toDecimal(binaryList, start, num=0, add=0):
    if(start == -1):
        return 0
    elif(binaryList[start] != 0):
        add += 2**num
    return toDecimal(binaryList, start-1, num+1) +add

print(toDecimal(list_one, len(list_one)-1))
cb7e7fc3bf10aea189316897540efe91646c9f40
<mask token>

<mask token>


def toDecimal(binaryList, start, num=0, add=0):
    if start == -1:
        return 0
    elif binaryList[start] != 0:
        add += 2 ** num
    return toDecimal(binaryList, start - 1, num + 1) + add


<mask token>

<mask token>


def toDecimal(binaryList, start, num=0, add=0):
    if start == -1:
        return 0
    elif binaryList[start] != 0:
        add += 2 ** num
    return toDecimal(binaryList, start - 1, num + 1) + add


print(toDecimal(list_one, len(list_one) - 1))

list_one = [1, 1, 1, 1, 1, 0]


def toDecimal(binaryList, start, num=0, add=0):
    if start == -1:
        return 0
    elif binaryList[start] != 0:
        add += 2 ** num
    return toDecimal(binaryList, start - 1, num + 1) + add


print(toDecimal(list_one, len(list_one) - 1))

list_one = [1, 1, 1, 1, 1, 0]


def toDecimal(binaryList, start, num=0, add=0):
    if(start == -1):
        return 0
    elif(binaryList[start] != 0):
        add += 2**num
    return toDecimal(binaryList, start-1, num+1) +add

print(toDecimal(list_one, len(list_one)-1))