In this Python program, we will learn how to convert decimal to binary, decimal to octal and decimal to hexadecimal number. For Converting decimal to binary, decimal to octal and decimal to hexadecimal, we will use the

function for conversion from decimal to binary and **bin()**

function for conversion from decimal to octal and **oct()**

function for converting decimal to hexadecimal numbers.**hex()**

Here is the code of the program to convert decimal to binary, decimal to octal and decimal to hexadecimal number.

```
# Python Program to Convert Decimal to Binary, Octal, and Hexadecimal
# To take the input from the user
DecNum = int(input("Enter the Decimal Number: "))
print("The decimal value of", DecNum, "is: \n")
print(bin(DecNum), "in binary.")
print(oct(DecNum), "in octal.")
print(hex(DecNum), "in hexadecimal.")
```

Enter the Decimal Number: 55

The decimal value of 55 is:

0b110111 in binary.

0o67 in octal.

0x37 in hexadecimal.

## Comments