Converting binary to decimal integer output
You can use int and set the base to 2 (for binary): >>> binary = raw_input(‘enter a number: ‘) enter a number: 11001 >>> int(binary, 2) 25 >>> However, if you cannot use int like that, then you could always do this: binary = raw_input(‘enter a number: ‘) decimal = 0 for digit in binary: … Read more