Convert Hex to Bytes in Python

Conversion

Using bytes.fromhex method, we can convert hex string to bytes string.

hex_str = "48656c6c6f20576f726c64"

bytes.fromhex(hex_str)
# b'Hello World'