summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorSmosker <smosker@gmail.com>2016-11-15 16:10:56 +0400
committerGitHub <noreply@github.com>2016-11-15 16:10:56 +0400
commitac6d64168f29f149ab9d8d5ea6b5fe785db229c3 (patch)
treef97b5525aeab661b6c80d9ec8a0847d292adaf85 /python.html.markdown
parent809e5d20a91c14adfd5ce54f481e674938c3719e (diff)
Fix a bug
Should add return to double_numbers function, without it next expression wiil fall with "TypeError: 'NoneType' object is not iterable" error for value in double_numbers(range(1000000)): # `test_non_generator` print value if value > 5: break
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown1
1 files changed, 1 insertions, 0 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 55f56071..6d881355 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -692,6 +692,7 @@ def double_numbers(iterable):
double_arr = []
for i in iterable:
double_arr.append(i + i)
+ return double_arr
# Running the following would mean we'll double all values first and return all
# of them back to be checked by our condition