I'm trying to write a python script that would output:
000
001
002
... etc
but I'm running into difficulties. What I have so far is:
from itertools import product
list = [x for x in range(0, 10) if True]
for x in product(list, repeat=3):
list3 = list(x)
def convert(l):
c = [str(i) for i in l]
list2 = int("".join(c))
return(list2)
print(convert(list3))
but this only outputs:
999
I'm not sure how to get the full list. If I comment out the convert function it provides multiple lists of the numbers, like so:
[0, 0, 0]
[0, 0, 1]
...
Any help would be appreciated, I'm pretty sure I'm missing something simple.