Discuss / Python / 作业~~

作业~~

Topic source

iLiDong

#1 Created at ... [Delete] [Delete and Lock User]
print(hex(n1))
print(hex(n2))

Arsans

#2 Created at ... [Delete] [Delete and Lock User]

我感觉你这做的不对,你最后输出的应该是整型16进制数而并非题目要求的字符串

老爸横行

#3 Created at ... [Delete] [Delete and Lock User]

返回的类型是一样的嘛

print(str(hex(n1)),type(str(hex(n1))))
print(hex(n2),type(hex(n2)))

Ryan_CL

#4 Created at ... [Delete] [Delete and Lock User]

hex()返回的本身就是字符串啊,层主的code没有问题吧

对着呢,print()打印的就是字符串


  • 1

Reply