Python hex() function
Published February 16, 2022The hex() function is a built-in Python function that transforms a number to its matching hexadecimal representation.
Syntax
The hex() function has the following syntax:
hex(integer or float to be converted to hexadecimal) |
Example
integer_number= 50 |
Output
The hexadecimal value of 50 is 0x32 The hexadecimal value of 78.9 is 0x1.3b9999999999ap+6 |
Article Contributed By :
|
|
|
|
227 Views |