- Understand what a data structure is and how they are used in Python.
- Learn which types of tasks data structures are used to solve.
- Sequence: a data structure in which data is stored and accessed in a specific order.
- Index: the location, represented by an integer, of an element in a sequence.
- Iterable: able to be broken down into smaller parts of equal size that can be processed in turn. You can loop through any iterable object.
- Slice: a group of neighboring elements in a sequence.
- Mutable: an object that can be changed.
- Immutable: an object that cannot be changed. (Many immutable objects appear mutable because programmers reuse their names for new objects.)
- List: a mutable data type in Python that can store many types of data. The most common data structure in Python.
- Tuple: an immutable data type in Python that can store many types of data.
- Range: a data type in Python that stores integers in a fixed pattern.
- String: an immutable data type in Python that stores unicode characters in a fixed pattern. Iterable and indexed, just like other sequences.
In this module, you learned about Python's built-in data structures:
- Sequences (lists, tuples, ranges, strings) are ordered collections of data.
- Dictionaries are the only mapping type in Python, connecting keys to values.
- Sets are unordered collections of unique elements. Their structure can be changed, but their elements cannot.
Knowledge of these data structures will allow you to move and manipulate data in an efficient and organized way. Make sure to get some practice with them- you're going to see them a lot!