How to start the iteration loop from 000 to 999 using while loop in python?
x1=0
x2=999
while x1 <= x2:
print (x1)
x1 += 1
don't use for loop, just while loop
How to start the iteration loop from 000 to 999 using while loop in python?
x1=0
x2=999
while x1 <= x2:
print (x1)
x1 += 1
don't use for loop, just while loop
You could use:
In [1538]: x1=0
...: x2=999
...:
...: while x1 <= x2:
...: print (str(x1).zfill(3))
...: x1 += 1
...:
Prints something like this:
000
001
002
003
004
005
006
007