LISTS

Oftentimes when programming, you're going to need a way to organize and manage sets of data.  This is no different than in real life.  If you're putting together an invite list for a party; or creating a shopping list; or even just a basic To Do list.  In each of these situations, organizing data in a list format makes the creating, sorting, managing and finding of the information easier and faster. 

Most programming languages have concepts of lists as well, and Python is no exception.  Using the Python programming language, you can create many types of lists, though the two most common types are lists of strings and list of numbers.  In general, a list is initially assigned to a variable and that variable can then be used to add to, sort, modify or recall one or more items from the list.

An example of a list of strings would be a list containing the names of the months of the year. To keep things simple, let’s just create a list containing the first five months; we’ll use a variable called “months”:

Notice how the entire list has brackets [ ] around it and how each of the items in the list are strings with quotation marks around them.

Now let’s look at some of the things we can do with that list…