I donโt think there is a built-in method for this, but itโs easy enough to prepare:
>>> int("".join([hex(ord(x))[2:] for x in "YZ"]), 16)
22874
This goes through base 16, which of course can be optimized. I will leave it an โexerciseโ.
source
share