Skip to content

Commit d8db743

Browse files
Merge pull request #187 from abrahamalbert18/master
All the 4 Digit Number Combinations
2 parents 0b7f34a + 8d3874f commit d8db743

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

4 Digit Number Combinations.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ALL the combinations of 4 digit combo
2+
def FourDigitCombinations():
3+
numbers=[]
4+
for code in range(10000):
5+
if code<=9:
6+
code=str(code)
7+
numbers.append(code.zfill(4))
8+
elif code>=10 and code<=99:
9+
code=str(code)
10+
numbers.append(code.zfill(4))
11+
elif code>=100 and code<=999:
12+
code=str(code)
13+
numbers.append(code.zfill(4))
14+
else:
15+
numbers.append(str(code))
16+
17+
for i in numbers:
18+
print i,
19+
20+
pass
21+
22+

0 commit comments

Comments
 (0)