a = [9, 10, 11,12,13,17,18]
b = []
for i ina:
c = hex(i)
end = c[2:]iflen(end) == 1:
end = '0' + end
b.append('0x' + end.upper())
print(str(b).replace("'",''))
Stone Forest的博客python 以16进制打印输出的方法打印整数16进制num=10print('%#x'%num)打印字符串中的16进制arr='12342535'for i in arr:print('%#x'%ord(i))以上这篇python 以16进制打印输出的方法就是小编分享给大家的全部内容了,...