print(hex(n1)) print(hex(n2))
我感觉你这做的不对,你最后输出的应该是整型16进制数而并非题目要求的字符串
返回的类型是一样的嘛
print(str(hex(n1)),type(str(hex(n1)))) print(hex(n2),type(hex(n2)))
hex()返回的本身就是字符串啊,层主的code没有问题吧
对着呢,print()打印的就是字符串
Sign in to make a reply
iLiDong