Discuss / Python / 交作业2019.2.13

交作业2019.2.13

Topic source
# -*- coding: utf-8 -*-

n1 = 255
n2 = 1000
print(str(hex(n1)),str(hex(n2)))

输出结果: 0xff 0x3e8 一行搞定,不过似乎不是那么的好看、

当冇If

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

hex()结果本身就已经是字符串了啊,没必要再套个str()


  • 1

Reply