Last Time
We discussed definite looping, which is implemented
by Python's for loop. This loop goes through a
collection using the collection's iterator. The
iterator is a rule that determines the order and manner of
access of the elements.
| Object | Iterator |
|---|---|
| list | This presents the elements of a list in their index order. |
| tuple | This presents the elements of a tuple in their index order. |
| range | This presents the elements range object in order. |
| string | This presents the characters in the string as one-character strings in index order. |
reversed
enumerate
Three Useful Modules
The import Statement
from math import *
math
sys
os and os.path