This hex()
function returns an integer converted into a hexadecimal string.
hex(integer)
Here,
Note: To obtain a hexadecimal string representation for a float, you need to use the float.hex() method.
>>> hex(100)
'0x64'
>>> hex(-30)
'-0x1e'
>>> hex(0b11)
'0x3'
>>> hex(0o67)
'0x37''