Skip to content

Commit

Permalink
Change onLineCombinations using list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Zhou authored and Luke Zhou committed Jan 28, 2018
1 parent f079291 commit 9cc0b56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.pyc
12 changes: 0 additions & 12 deletions 4 Digit Number Combinations.py

This file was deleted.

5 changes: 5 additions & 0 deletions four_digit_num_combination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Same as above but more pythonic
def oneLineCombinations():
""" print out all 4-digit numbers """
numbers = [str(i).zfill(4) for i in range(10000)]
print(numbers)

0 comments on commit 9cc0b56

Please sign in to comment.