1>>> bytes.fromhex('HexValue').decode('utf-8')
2'string'
3>>> bytes.fromhex('7368616b6564').decode('utf-8')
4'shaked'
1>>> s = 'The quick brown fox jumps over the lazy dog.'.encode('utf-8')
2>>> s
3b'The quick brown fox jumps over the lazy dog.'
4>>> s.hex()
5'54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e'
6
1hex_string = "0xAA"
2# "0x" also required
3
4an_integer = int(hex_string, 16)
5# an_integer is a decimal value
6
7hex_value = hex(an_integer)
8print(hex_value)