0

I made a program for converting binary to decimal but it's not working can anybody please tell me what I have done wrong??

binary_digits=' ' def input_function(binary_digits): while binary_digits not in [0,1]: binary_digits=input("Please enter your binary number here:") return int(binary_digits) def converter_function(binary_digits): x=list(binary_digits) for u in range (0,len(x)): for i in range(1,len(x)):decimal_number == sum((x[u] * 2 ** (len(x) - i))) return decimal_number while True: y=input_function(binary_digits) z=converter_function(y) print(f"The number in the decimal form is{z}") break

9th Jan 2022, 6:13 AM
shreyash tekade
1 Resposta
0
Put decimal_number = sum((.....) in converter_functiom You have given decimal_number == sum((.....)
9th Jan 2022, 8:28 AM
Adi Nath Bhawani
Adi Nath Bhawani - avatar