Skip to content

Commit

Permalink
day 188: add python version and python fix for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
vaskoz committed Feb 27, 2019
1 parent ed602c0 commit 093475b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions day188/problem.py
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()
15 changes: 15 additions & 0 deletions day188/problem_correct.py
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()

0 comments on commit 093475b

Please sign in to comment.