Question #169

What it the output of the code snippet below?
print(hex(0.5))

It will throw a TypeError error. The hex() function only takes integers as arguments. Floats can be converted to their hexadecimal form with the float.hex() function. (geeksforgeeks.org/python-hex-function)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: