Write a program in Python that takes the output above in BIN
Write a program in Python that takes the output above in BINARY and converts it to DECIMAL. Please help
Solution
Answer:
binary = raw_input ( \' enter a number \' )
decimal = 0
for digit in binary :
decimal = decimal * 2 + int (digit)
print decimal

