I wanted to generate numbers starting from 000 to 120 in sequence. I know you can generate numbers from 0 to 120 by using a loop.But I want all the numbers to have 3 digits.
["{0:03}".format(i) for i in range(121)]
or
["%03d" % i for i in range(121)]
To print:
print "\n".join()
More terse in Python 3.6+:
[f"{i:03}" for i in range(121)]