WAP to convert binary number to decimal number.
1 Like
binary = input("Enter a binary number: ") decimal = 0 for digit in binary: decimal = decimal * 2 + int(digit) print("The decimal equivalent of", binary, "is", decimal)
Enter a binary number: 110 The decimal equivalent of 110 is 6
Answered By
2 Likes
WAP to display even numbers between 10 and 20.
WAP to perform all the mathematical operations of a calculator.
Write a Python program to compute sum of digits of a given number.
Write a function to display prime numbers below 30.