Assembled by Adam Whaley, Original Text: How to Think like a Computer Scientist., Original Text: Problem Solving with Algorithms and Data Structures, Original Text: Python for Everybody - Interactive
The first example is a list of four integers. The second is a list of three strings. As we said above, the elements of a list donβt have to be the same type. The following list contains a string, a float, an integer, and another list.
A list within another list is said to be nested and the inner list is often called a sublist. Finally, there is a special list that contains no elements. It is called the empty list and is denoted [].