-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
day 188: add python version and python fix for completeness
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 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,13 @@ | ||
def make_functions(): | ||
flist = [] | ||
|
||
for i in [1, 2, 3]: | ||
def print_i(): | ||
print(i) | ||
flist.append(print_i) | ||
|
||
return flist | ||
|
||
functions = make_functions() | ||
for f in functions: | ||
f() |
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,15 @@ | ||
def make_functions(): | ||
flist = [] | ||
|
||
for i in [1, 2, 3]: | ||
def build_print_i(i): | ||
def print_i(): | ||
print(i) | ||
return print_i | ||
flist.append(build_print_i(i)) | ||
|
||
return flist | ||
|
||
functions = make_functions() | ||
for f in functions: | ||
f() |