The collection is nothing but a group of items.
There are 4 collection data types in Python and they are,
List
A list is a collection that is ordered and changeable. Lists are written using square brackets([]).
Syntax:
list_variable = [list values in double-quotes separated with comma operator]
Example:
Access items from List:
We can access the items of the List using the index.
For example, if you want to print the second item of the List, we can do in the following way,
Output:
#collection #lists #python #advanced