File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,10 @@ Or if we just want to clear a list, we can use the `clear`
275
275
>> >
276
276
```
277
277
278
+ Later we'll learn that for loops are not actually limited to lists.
279
+ There are many other things we can for loop over. Things that can be for
280
+ looped over are called ** iterables** .
281
+
278
282
If you're using Python 3.2 or older you need to use ` stuff[:] ` instead
279
283
of ` stuff.copy() ` and ` stuff[:] = [] ` instead of ` stuff.clear() ` .
280
284
` stuff[:] ` is a slice of the whole list, just like ` stuff[0:] ` .
@@ -285,6 +289,7 @@ of `stuff.copy()` and `stuff[:] = []` instead of `stuff.clear()`.
285
289
- While loops repeat something as long as a condition is true, and
286
290
they check the condition only in the beginning.
287
291
- For loops can be used for repeating something to each item in a list.
292
+ - An iterable is something that can be for looped over.
288
293
- The ` break ` keyword can be used to interrupt the innermost loop at
289
294
any time.
290
295
You can’t perform that action at this time.
0 commit comments