From 007b9531504a33b36475a2bf1806d6a4329de38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giorgi=20Tsutskiridze=20=28=E1=83=92=E1=83=98=E1=83=9D?= =?UTF-8?q?=E1=83=A0=E1=83=92=E1=83=98=20=E1=83=AA=E1=83=A3=E1=83=AA?= =?UTF-8?q?=E1=83=A5=E1=83=98=E1=83=A0=E1=83=98=E1=83=AB=E1=83=94=29?= Date: Fri, 4 Feb 2022 09:28:02 +0400 Subject: [PATCH] range is not a generator range in Python is not a generator. zip and enumerate are. So, I delted range in the sentence above. --- lectures/python_fundamentals/collections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/python_fundamentals/collections.md b/lectures/python_fundamentals/collections.md index fbb19a9b..69d21c3d 100644 --- a/lectures/python_fundamentals/collections.md +++ b/lectures/python_fundamentals/collections.md @@ -452,7 +452,7 @@ See exercise 4 in the {ref}`exercise list `. An important quirk of some iterable types that are not lists (such as the above `zip`) is that you cannot convert the same type to a list twice. -This is because `zip`, `enumerate`, and `range` produce what is called a generator. +This is because `zip` and `enumerate` produce what is called a generator. A generator will only produce each of its elements a single time, so if you call `list` on the same generator a second time, it will not have any elements to iterate over anymore.