The hex() function takes a numeric parameter and returns the corresponding hexadecimal value. 0x is always pretended to be the string that is returned.