Complex Data Types
Understand complex data types in Python.
In the previous lesson, you learned about basic data types. These are the building blocks for complex data types. Think of complex data types as containers, each holding many (potentially different) data types.
List
A list is a container data type that stores a sequence of elements.
It is an ordered sequence of data values (either basic or complex data types). An example for such an ordered sequence is the list of all presidents of the United States:
['Washington', 'Adams', 'Jefferson', ..., 'Obama', 'Trump']
Unlike strings, lists are mutable. In other words, modification is possible.
Example
An example of a list is as below:
Get hands-on with 1200+ tech skills courses.