Q. Write a program to convert a binary number into decimal number.


Answer :-

num = int(input("Enter the Binary number:- "))
print (int(str(num), 2))


Output:-

Enter the Binary number:- 101010
42
>>>

1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post