I have a long string with hexadecimal characters, for example:
string = "AA55CC3301AA55CC330F234567"
I am using
string.to_bytes(4, 'little')
I would like the final string to be as follows:
6745230F33CC55AA0133CC55AA
but I am getting an error
AttributeError: 'str' object has no attribute 'to_bytes'
What's wrong here?