Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBinary To Decimal Conversion #3495
Conversation
Travis tests have failedHey @MeenakshyBS, TravisBuddy Request Identifier: 1d34f920-1132-11eb-bfd1-1f84b849c73d |
b_num = list(input("Input a binary number: "))
value = 0
for i in range(len(b_num)):
digit = b_num.pop()
if digit == '1':
value = value + pow(2, i)
print("The decimal value of the number is", value)