I just started working with hexadecimal values in python and am a bit surprised with what I just encountered. I expected the following code to first print a hexadecimal string, and then a decimal value.
Input:
n = 0x8F033CAE74F88BA10D2BEA35FFB0EDD3
print('Hex value for n is:', n)
print('Dec value for n is:', int(str(n), 16))
Output:
Hex value for n is: 190096411054295805012706659640261275091
Dec value for n is: 8921116140846515089057635273465667902228615313
How is it possible that 2 different different numbers are shown? I expected the first number to be a hexadecimal string and the second it's decimal equivalent, what is this second value in this case?