调用函数,作业
Topic source有的
浮点数转十六进制
print(float.hex(9.8))
字符串转十六进制
int('0x1e',16) binascii.b2a_hex(u"你好啊".encode("utf8"))
关于字符串转十六进制,能再帮我看看到底哪里不对吗?
n4='你好'
print(n4,'的十六进制是:',binascii.b2a_hex(u"你好".encode("utf8"))
另外,int('0x1e',16)是什么用处,不理解啊
不好意思,我自己找到原因了! 非常感谢~
n4='你好'
import binascii
print(n4,'的十六进制是:',binascii.b2a_hex(n4.encode("utf8")))
- 1
用户6223899516_84125
谁能给说说,关于float和str的hex结果,没有16进制吗?