...

/

Complex Data Types

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 ...

Access this course and 1400+ top-rated courses and projects.