SyntaxFix
Write A Post
Hire A Developer
Questions
To use the hex encoding in Python 3, use
hex
>>> import codecs >>> codecs.encode(b"c", "hex") b'63'
In legacy Python, there are several other ways of doing this:
>>> hex(ord("c")) '0x63' >>> format(ord("c"), "x") '63' >>> "c".encode("hex") '63'