How to convert
x = "0x000000001" # hex number string
to
y = "1"
How to convert
x = "0x000000001" # hex number string
to
y = "1"
Use int() and provide the base which your number is in (in your case 16).
Then apply str() to convert it back to a string:
y = str(int(x, 16))
Note: If you omit the base then the default base 10 is used which would result in a ValueError in your case.
You can do:
y = int("0x000000001", 16)
in your case:
y = int(x, 16)
Looks like you want the int converted to string:
y = str(int(x, 16))