In this basic python program, we will convert the Decimal to Binary number.
Steps to solve the program
- Take a decimal number as input.
- Convert the decimal number to its binary number using {0:b}.format(int(num)).
- Print the output.
num = int(input("Enter a number: "))
print(f"Binary form of {num} is: ","{0:b}".format(int(num)))
Output :
Enter a number: 25
Binary form of 25 is: 11001