I want a program to print this output in the terminal :
0000
0001
0002
...
0010
0011
...
9990
9991
...
Because I wanted to find all 4-digit pincodes with 0 to 9 digits.
So I started writing this program in python :
num = ""
for a in range(0 , 10) :
num += str(a)
for b in range(0 , 10) :
num += str(b)
for c in range(0 , 10) :
num += str(c)
for d in range(0 , 10) :
num += str(d))
print(num)
num = ""
But I received this output :
2
3
4
5
6
7
8
9
9000
1
2
...
30
...
100
...
So I decided to test another program :
num = []
for a in range(0 , 10) :
num.append(str(a))
for b in range(0 , 10) :
num.append(str(b))
for c in range(0 , 10) :
num.append(str(c))
for d in range(0 , 10) :
num.append(str(d))
print(num)
num = []
But again I didn't succeed :
['2']
['3']
['4']
['5']
['6']
['7']
['8']
['9']
['9', '0', '0', '0']
...
['4']
['5']
...
['7']
...
['9', '0']
...
['9']
['9', '0', '0']
...
['5', '0']
['1']
...
['6', '0']
...
['7', '0']
...
['8', '0']
...
['9', '0']
['1']
['2']
['3']
['4']
...
['9']
Does anybody knows how to solve this problem?