python 进制转换

 

# 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.")

 

posted @ 2018-11-19 20:02  anobscureretreat  阅读(180)  评论(0)    收藏  举报