Lists are used to store and manipulate an ordered collection of things.

Table of contents
Lists are ordered collections
This is a list:
>>> colors=["purple","green","blue","yellow"]We can prove that to ourselves by passing that object to Python's built-in type function:
>>> type(colors)<class 'list'>Lists are ordered collections of things.
We can create a new list by using square brackets ([]), and inside those square brackets, we put each of the items that we'd like our list to contain, separated by commas:
>>> numbers=[2,1,3,4,7,11]>>> numbers[2, 1, 3, 4, 7, 11]Lists can contain any type of object. Each item in a list doesn't need to be of the same type, but in practice, they typically are.
So we might refer to this as a list of strings:
>>> colors=["purple","green","blue","yellow"]While this is a list of numbers:
>>> numbers=[2,1,3,4,7,11]Containment checking
We can check whether a …