一个16进制整数字符串转10进制数字
import math
def test1():
#拿到16进制的列表
hex= [ord(i)-55 if (i in list("ABCDEF")) else ord(i)-48 for i in input().upper()]
list1=[ hex[-1-i]*math.pow(16,i) for i in range(len(hex))]
return sum(list1)
参考链接https://blog.csdn.net/xHibiki/article/details/82924442
多个16进制整数字符串转10进制数字
str1="12AB" #0x12 0xAB
print(int(str1))
i=0
while(i<len(str1)):
s1=str1[i:i+2]
i+=2
print((int(s1,16)))
参考链接
https://www.cnblogs.com/dylancao/p/10039062.html
https://www.cnblogs.com/sl372/articles/10825681.html