Skip to content

Home

Number to hex

Returns the hexadecimal representation of the given number.

def to_hex(dec):
  return hex(dec)

to_hex(41) # 0x29
to_hex(332) # 0x14c

More like this

Start typing a keyphrase to see matching snippets.