Lists in Python
Lists are the most significant and flexible sequence types in Python. A list in Python is simply an ordered collection of items each of which can be of any type. A list is a dynamic mutable data structure which means that items can be added to and deleted from it.
List constants are surrounded by square brackets and the elements in the list are separated by commas. The individual elements of the list can be accessed using the square brackets by specifying the item's index. The first element is at index 0. Indexes range from 0 to n-1 (where n is the length of the list) and from -1 to -n.
Lists are heterogeneous, i.e., values can be of any type (strings are homogeneous because their elements are characters).
The following is an example of a list and how we can access elements of the list.
1>>> vals = [1, 2, 3, 4,