8.4 Lists
Python’s generic list structure is integrated into a number of language features. We can, for example, visit all the items in a list without explicitly requesting an iterator object, and we can construct a list (as with a dictionary) with very simple-looking comprehension syntax. Further, list comprehensions and generator expressions turn lists into a veritable Swiss Army knife of computing functionality.
If you don’t know how to create or append to a list, how to retrieve items from a list, or what slice notation is, we direct you to the official Python tutorial. See section 3.1.3 ( https://docs.python.org/3/tutorial/introduction.html#lists) and section 5.1 ( https://docs.python.org/3/tutorial/datastructures.html#more-on-lists) of the Python Tutorial. Also, the Modern Python Cookbook, Chapter 4, has several recipes related to lists.
In Python, lists should normally be used when we want to store several instances of the same type of object...