 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
Some
things can behave as if they are sequences. You can loop
|
|
over
them. However, you cant index them. These are called
|
|
|
iterators
|
|
|
| |
A file
can behave like a sequence of lines:
|
|
|
>>> for line in file(
.)
|
|
|
...
|
|
|
| |
A
dictionary can behave like a sequence of keys.
|
|
|
>>> for word in wordcount:
|
|
|
... print word,
wordcount[word]
|
|