The data type list is an ordered sequence which is mutable and made up of one or more elements.
- A list can have elements of different data types , such as integer, float, string, tuple or even another list.
- A list is very useful to group together elements of mixed data types.
- Elements of a list are enclosed in square brackets and are separated by comma.
- Like string indices, list indices also start from 0.
Accessing elements in a List
The elements of a list are accessed in the same way as characters are accessed in a string.
The list items are accessed by referring to the index number in square brackets.
Lists are Mutable
In python, lists are mutable ie., the contents of the list can be changed after it has been created.