Home >>Python Built-in Functions >Python hex() Function
Python hex() function is used to convert the given input number into a corresponding hexadecimal value. The returned string will always start with the prefix 0x.
Syntax:hex(number)
Parameter | Description |
---|---|
number | This parameter defines an Integer. |
x = hex(100)
print(x)
x = hex(250)
print(x)