programming-examples/python/Basics/Python Program to Convert Decimal to Binary, Octal and Hexadecimal.py

9 lines
284 B
Python
Raw Normal View History

2019-11-18 14:44:36 +01:00
# Python program to convert decimal number into binary, octal and hexadecimal number system
# Change this line for a different result
dec = 344
print("The decimal value of",dec,"is:")
print(bin(dec),"in binary.")
print(oct(dec),"in octal.")
print(hex(dec),"in hexadecimal.")