File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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`
275275>> >
276276```
277277
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+
278282If you're using Python 3.2 or older you need to use ` stuff[:] ` instead
279283of ` stuff.copy() ` and ` stuff[:] = [] ` instead of ` stuff.clear() ` .
280284` 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()`.
285289- While loops repeat something as long as a condition is true, and
286290 they check the condition only in the beginning.
287291- 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.
288293- The ` break ` keyword can be used to interrupt the innermost loop at
289294 any time.
290295
You can’t perform that action at this time.
0 commit comments