I've written the python script below to convert hexadecimal to decimal. It seems to work fine, at least as long as the hexadecimal has less then 8 characters .
What did I do wrong ? Tnx !
""" converts hexidecimal to decimal"""
def HextoDec (string):
ret = 0
for i in string :
hex = "0123456789ABCDEF"
value= hex.index(i) # 0 to 15
index = string.index(i)
power = (len(string) -(index+1)) #power of 16
ret += (value*16**power)
return ret
print(HextoDec("BAABFC7DE"))