Discuss / Python / format可以去除0x

format可以去除0x

Topic source

起落

#1 Created at ... [Delete] [Delete and Lock User]
n1 = 255
n2 = 1000

print(hex(n1))

print(hex(n2))

print(format(n1,'x'))

print(format(n2,'x'))

0xff

0x3e8

ff

3e8


  • 1

Reply