The next four types described (str,
unicode, list and
tuple) are collectively referred to as
sequence types.
Each sequence value represents an ordered set in the mathematical sense, that is, a collection of things in a specific order.
Python distinguishes between mutable and immutable sequences:
An immutable sequence can be created or destroyed, but the number, sequence, and values of its elements cannot change.
The values of a mutable sequence can be changed. Any element can be replaced or deleted, and new elements can be added at the beginning, the end, or in the middle.
There are four sequence types, but they share most of the same operations.
Section 9, “Type str: Strings of 8-bit
characters” (immutable).
Section 10, “Type unicode: Strings of 32-bit
characters” (immutable).
Section 11, “Type list: Mutable sequences” (mutable).
Section 12, “Type tuple: Immutable sequences” (immutable).