11
Format the string to be padded with 0's. To get a list of 0 to 9999 padded with zeroes:
["%04d" % x for x in range(10000)]
Same thing works for 5, 6, 7, 8 zeroes, etc. Note that this will give you a list of strings. There's no way to have an integer variable padded with zeroes, so the string is as close as you can get.
The same format operation works for individual ints as well.
Maybe str.zfill could also help you:
>>> "1".zfill(4)
'0001'