Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Assignment no: 5

Title:
Write a Python program to input binary number from user and convert it into decimal
number.
Aim:
To input binary number from user and convert it into decimal number.
Theory:
A binary number is a number expressed in the base-2 numeral system or binary numeral
system, which uses only two symbols 0 and 1.
The decimal numeral system is the standard system for denoting integer and non-integer
numbers.
All decimal numbers can be converted to equivalent binary values and vice versa for example,
the binary equivalent of "2" is "10" to explore more visit binary to decimal converter.

Algorithm:
Step1: Start
Step2: Input binary value
Step3: Condition - for i in bin:
dec=dec*2+int(i)
Step4: Print – decimal
Step5: Stop

Conclusion:
Able to convert of conversion of Binary value to Decimal value by using Python
programming language.

You might also like