Python hex() Function
Converts a number to its hexidecimal value.
Syntax
Python
Copy Code
hex(number)
Parameters
Parameter | Description |
---|---|
number |
Required. The value to convert |
Example
Python
Copy Code
print(hex(12648430))
Output
0xc0ffee