Complex Data Types
Explore Python's complex data types such as lists, sets, and dictionaries. Understand how to create and manipulate these containers using list comprehensions, built-in functions, and key operations to organize and access data effectively.
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 ...