Python Binary number to decimal simple convertor
10:19 07 Oct 2014
userinput=(input ("Please Enter Your Binary Number"))


lengh=len (userinput)

x=lengh-1
num=(2**x)


char2=-lengh

for i in range(lengh)

int(userinput[char2])*num

x=x-1
char2=char2+1

Basically, I am trying to make a Binary to decimal converter for my GCSE using only simple commands. How should I arrange the for loop so that it runs until all the numbers are converted. Furthermore, how can I print out the addition of all the calculations.

python for-loop binary decimal