3 ms·
Also: '416D65726963612043616E20436F646520'.decode('hex') Edit: In Python 3, bytes.fromhex('416D65726963612043616E20436F646520').decode('utf-8')
by Mithrandir 13y ago
Also:
'416D65726963612043616E20436F646520'.decode('hex')
Edit: In Python 3,
bytes.fromhex('416D65726963612043616E20436F646520').decode('utf-8')
- Patrick_Devine 13y agonice! Mine was similar to olefoo's: x = "416d65726963612043616e20436f646520" ''.join([chr(int(y, 16)) for y in [x[l:l+2] for l in range(0, len(x), 2)]]) I do think it's funny that they (erroneously?) put the extra space on the end of the string. If you read the press release for the bill I don't think the 20 is supposed to be there.
- olefoo 13y agoSweet, I didn't even think of using the string methods; always nice to have a blind spot pointed out.
- VMG 13y agoMithrandir Can Code!