利用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+"
")
原文地址:https://www.cnblogs.com/xiaozi/p/10794903.html