← Code LabPython0/50 solved · 0%
Web3 integration · medium

33. Bytes and hex encoding

Convert between hex text and raw bytes.

Write `hex_to_bytes(hex_str)` that strips an optional `"0x"` prefix and returns the corresponding `bytes` using `bytes.fromhex`.
Required in your answer: bytes.fromhexstartswith