Question: Please write a Python program to take a string from the user and convert it to an unsigned binary integer and return the decimal value

Please write a Python program to take a string from the user and convert it to an unsigned binary integer and return the decimal value of that integer. You can assume the user input contains only "0" and "1".
For example
If the input is "1101", your program should return "13".
If the input is "11111111", your program should return "255".
If the input is "01100101010111001111010101111001",
your program should return "1700590969".
Please call your program with different input arguments and check its correctness.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!