forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change onLineCombinations using list comprehension
- Loading branch information
Luke Zhou
authored and
Luke Zhou
committed
Jan 28, 2018
1 parent
f079291
commit 9cc0b56
Showing
3 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
*.pyc |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |