0
Counter: 0000,0001,0002
I want to make a counter and use it as string to name a file. Number of digits must be constant. How can I do that in python?
1 Answer
+ 5
If you display them as Strings you can use this
s = "1"
print s.zfill(4)
Output :
0001