Python hex() 函数

描述

hex() 函数用于将10进制整数转换成16进制整数。

hex 语法:

>>>hex(255)
'0xff'
>>> hex(-42)
'-0x2a'
>>> hex(1L)
'0x1L'

你可能感兴趣的:(Python hex() 函数)