利用python输出000至999中间的数
打造一个000-999的字典
for i in range(1000):
if i<10:
i = '00'+str(i)
elif 10<=i and i<100:
i ='0'+str(i)
else:
i=str(i)
with open('1.txt', 'a') as f:
f.write(i+"\n")
微信扫一扫
打造一个000-999的字典
for i in range(1000):
if i<10:
i = '00'+str(i)
elif 10<=i and i<100:
i ='0'+str(i)
else:
i=str(i)
with open('1.txt', 'a') as f:
f.write(i+"\n")
相关推荐