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.
The output should be
000
001
002
...
...
120
Instead of
0
1
2
...
...
120
Is there any easy way to achieve this in python or should I be making separate code for 0-9 10-99 and 100-120 ?
print("{:03}".format(x))- mishik