Discuss / Python / 用 hex() 函数把整数转换成十六进制表示的字符串

用 hex() 函数把整数转换成十六进制表示的字符串

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

n1 = 255
n2 = 1000

h1 = hex(n1)
h2 = hex(n2)
print(h1)
print(h2)


  • 1

Reply