Skip to content

Commit c88655d

Browse files
Merge pull request geekcomputers#189 from abrahamalbert18/patch-2
Update 4 Digit Number Combinations.py
2 parents 0167bbd + 8992a85 commit c88655d

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

4 Digit Number Combinations.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
#ALL the combinations of 4 digit combo
1+
# ALL the combinations of 4 digit combo
22
def FourDigitCombinations():
33
numbers=[]
44
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-
5+
code=str(code).zfill(4)
6+
print code,
7+
numbers.append(code)

0 commit comments

Comments
 (0)