What is a List?
Lists are data collections that contain
ordered data and
have a finite number of elements that can be
accessed using
indices. Additionally, lists can be modified after creation, as you will see below. The data type is called
list.
A list contains multiple data elements, in this case, strings, which are grouped and separated by the comma operator "
," and is
defined directly
between two square brackets:
DETAILS
Accessing list elements is done similarly to strings, using indexing from
0 to
len()-1, which is the
length of the list in this case, minus one:
Lists are very cool! They can hold data of different types, as you will see next!
Run the program, then proceed to the next page.