Built-in Functions
hex()
Convert an integer to a hexadecimal string.
hex(number)
hex() shows an integer in base 16. The result begins with 0x to mark it as hexadecimal.
Parameters
| Name | Description |
|---|---|
| number | An integer, or an object that defines integer conversion. |
Returns
A hexadecimal string beginning with 0x.
Try it
Run it and change it
number = 255 print(hex(number))