?
What does the built-in function hex() do in Python?
Answer & Solution
Correct Answer:
Option
A
The correct answer is Option A: Converts an integer to a hexadecimal string.
The hex() function in Python is used to convert an integer to a lowercase hexadecimal string.
For example:
The hex() function in Python is used to convert an integer to a lowercase hexadecimal string.
For example:
print(hex(15)) # Output: '0xf'
print(hex(255)) # Output: '0xff'
Join the Discussion
Login to post a comment or share your explanation.
Login