If you want to print from 0000 to 9999 try
#If not python3 uncomment line below
#from __future__ import print_function
for i in range(10000):
print("{:04d}".format(i))
If you want to print from 0000 to 9999 try
#If not python3 uncomment line below
#from __future__ import print_function
for i in range(10000):
print("{:04d}".format(i))