I need to convert a binary input into a decimal integer. I know how to go from a decimal to a binary:
n = int(raw_input(\'enter a number: \')) print \'{0:b}\'.fo
a = input('Enter a binary number : ') ar = [int(i) for i in a] ar = ar[::-1] res = [] for i in range(len(ar)): res.append(ar[i]*(2**i)) sum_res = sum(res) print('Decimal Number is : ',sum_res)