16 September 2021

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.

ObjectIterator
listThis presents the elements of a list in their index order.
tupleThis presents the elements of a tuple in their index order.
rangeThis presents the elements range object in order.
stringThis 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

Indefinite Looping