mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
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
This commit is contained in:
parent
809e5d20a9
commit
ac6d64168f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user