supreme-dark 发表于 2018-9-29 12:55:23

python代码的理解问题,求解答

int(b"hello".hex(),16)求助
这行代码要怎么理解啊,那个b和后面的那个.hex()分别有什么用啊
谢谢

冬雪雪冬 发表于 2018-9-29 13:54:00

b"hello"是字节型字符串,与str型的转换如下:
b"hello".decode(b"hello")##转为str
"hello".encode()##转为字节型
.hex()为每个字符的16进制编码
页: [1]
查看完整版本: python代码的理解问题,求解答