List in Python:
The list is one of the data type available in Python. The items in the list are separated by comma values and which are placed between square brackets.
NOTE: The items in a list need not be of the same type.
Creating a list is as simple as putting different comma-separated values between square brackets. For example −
My_list1 = ['String', 'String2', 12, 232]
My_list2 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
My_list3 = ["a", "b", "c", "d", "e", "f", "g"];
Accessing Values in Lists
By using the square brackets for slicing along with the index we can access the values in the list or we can use indices to obtain value available at that index.