Editor settings

General settings

Save settings

Learn to program with Python

Nested Lists in Python #

Because lists in Python can contain any other types of data, they can also contain other lists.

For example, here's a list that contains 3 lists, and each of those lists also contains 3 number elements.

my_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

Exercise #

  • Create a list my_nested_list with 3 elements
  • All 3 elements must be lists
Output will be displayed here