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
>>>
Answer :-
num = int(input("Enter the Binary number:- ")) print (int(str(num), 2))
good job
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )