From ac6d64168f29f149ab9d8d5ea6b5fe785db229c3 Mon Sep 17 00:00:00 2001 From: Smosker Date: Tue, 15 Nov 2016 16:10:56 +0400 Subject: 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 --- python.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'python.html.markdown') 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 -- cgit v1.2.3