1def getBaseTen(binaryVal):
2 count = 0
3
4 #reverse the string
5 binaryVal = binaryVal[::-1]
6
7 #go through the list and get the value of all 1's
8 for i in range(0, len(binaryVal)):
9 if(binaryVal[i] == "1"):
10 count += 2**i
11
12 return count