Lists in Python
In this lesson, we will begin to study a special data type called list. A list is a variable that can store a whole set of values in an ordered form:
lst = [1, 2, 3]
Each value in the list is called a element. As you can see, the elements are separated by a comma.
A list can store different types of data: strings, numbers, booleans, and even other lists:
lst1 = ['1', '2', '3']
lst2 = [1, 2, 3]
lst3 = [True, False]
lst4 = [['a', 'b'], ['c', 'd']]
Also, the list can contain different types of data at the same time:
lst = [1, 'a', True] # number, string, boolean
We will look at ways to create lists in the following lessons.