python - How to convert each digit in an int to hex -
i want convert integer variable hex value digit wisely. means, 499, need output of "/x04/x09/x09". please help.
use string formatting functions:
n = 499 print("".join("\\x{0:02x}".format(int(i)) in str(n))) prints
\x04\x09\x09
Comments
Post a Comment