mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 09:14:39 +02:00
Merge pull request #1478 from aayushranaut/master
Range is not a generator
This commit is contained in:
@@ -664,8 +664,6 @@ def double_numbers(iterable):
|
|||||||
# Instead of generating and returning all values at once it creates one in each
|
# Instead of generating and returning all values at once it creates one in each
|
||||||
# iteration. This means values bigger than 15 wont be processed in
|
# iteration. This means values bigger than 15 wont be processed in
|
||||||
# double_numbers.
|
# double_numbers.
|
||||||
# Note range is a generator too. Creating a list 1-900000000 would take lot of
|
|
||||||
# time to be made
|
|
||||||
# We use a trailing underscore in variable names when we want to use a name that
|
# We use a trailing underscore in variable names when we want to use a name that
|
||||||
# would normally collide with a python keyword
|
# would normally collide with a python keyword
|
||||||
range_ = range(1, 900000000)
|
range_ = range(1, 900000000)
|
||||||
|
Reference in New Issue
Block a user