File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1422,12 +1422,11 @@ Ever wondered how this works? Python implements this using Iterables and Iterato
1422
1422
1423
1423
- ```python
1424
1424
# Unlike lists, you can't do a for loop over this more than once
1425
- my_generator = (x * x for x in range (3 ))
1426
-
1427
- # Generators can only be iterated over ONCE. They do not store values in memory,
1428
- # but instead generate them on the fly
1429
- ```
1430
-
1425
+ my_generator = (x * x for x in range (3 ))
1426
+
1427
+ # Generators can only be iterated over **ONCE**. They do not store values in memory, but instead generate them on the fly
1428
+ ```
1429
+
1431
1430
- ** Iterators** are objects that define how the iteration is done! (Specifically, what the next item to be iterated is .)
1432
1431
1433
1432
- Think of them as text ' cursors' that point to objects in an iterable
You can’t perform that action at this time.
0 commit comments