PyDocs

Nav

Python Runtime Services

hex

builtins

function
  • hex(integer, /)
Return the hexadecimal representation of an integer.

>>> hex(12648430)
'0xc0ffee'
1 Example
>>> hex(255)
'0xff'
>>> hex(-42)
'-0x2a'
from the Python docs
See Also
No see-alsos for builtins/hex
0 Notes
No notes for hex