Mutability and Order
Before we dive in, let’s go over some important terms.
Mutable and immutable. An object (everything in Python is an object) is mutable if it can be changed after creation and immutable if it can’t be changed after creation. Examples of mutable objects: list, set, and dictionary. Examples of immutable objects: boolean, integer, floating-point, string, and tuple.
Ordered and unordered. Objects inside a data structure (a data structure is a storage format like a list) are considered ordered if there is some order in which the objects are stored in the data structure. This means you can index. Objects inside a data structure are considered unordered if there is no order in which the objects are stored. This means you cannot index.