Definition
The hex() function converts the specified number into a hexadecimal value.
The returned string starts with the prefix 0x.
Syntax
hex(n)
Parameters
Parameter | Description |
---|---|
n | Required. Integer. |
Examples
myHex = hex(256)
print(myHex)