Write a Python Program to Convert Decimal to Binary, octal, and Hexadecimal with an example. In this Python example, we used the bin (converts to binary), oct (for octal), and hex (for hexadecimal) functions.
decimal = int(input("Please Enter the Decimal Number = "))
binary = bin(decimal)
octal = oct(decimal)
hexadecimal = hex(decimal)
print(decimal, " Decimal = ", binary, "Binary Value")
print(decimal, " Decimal = ", octal, "Octal Value")
print(decimal, " Decimal = ", hexadecimal, "Hexadecimal Value")

Also Read
- Python Program to Convert Centimeters to Meters and Kilometers
- Python Program to Convert Kilometers to Miles