如何写Python程序输出的数据是十六进制的?
要求输出的数据是十六进制的。0000
0001
0002
0003
0004
......
000E
000F
输出的数字要求是大写的。
我写的代码,有点问题啊。[code]# -*- coding: UTF-8 -*-
count = 0
while count <= 20:
print('%032x' count)
# 输出32位十六进制数[/code] [b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=221691&ptid=53267]1#[/url] [i]netdzb[/i] [/b]
自己搞定了
# -*- coding: UTF-8 -*-
count = 0
while count <= 20:
print('%032x' %count)
count = count + 1
# 输出32位十六进制数
页:
[1]