方法1
a=range( 100 )
for i in range(len(a)):
print("{0:06d}".format( a[i] ))
方法2
a=range( 20 )
for i in range(len(a)):
print("%08d" % (a[i]))
方法3
a=range( 20 )
for i in range(len(a)):
print("0"*(10-len( str( a[0] ) ) )+str( a[i] ))