 Let's consider this program to calculate the average of seven days worth of temperatures in degrees Celsius. Nothing remarkable here, except it's very repetitive. What if we wanted a month's worth of temperatures? That would be a real mess. Instead of having a separate variable for each day, we can use a list to group all of the items together under one name. You create a list by putting the items separated by commas, inside of square brackets. Then you can use a for loop to iterate through the list and get the total of all the temperatures. Here's the program and the result when we run it. Much as strings are collections of characters, a list is a collection of data items. And many of the things we have learned about strings apply to lists as well. For example, the lend function works on lists to give us the number of items in the list. Just as you can add two strings together, this list plus this other list concatenates them into a new list. And just as you can multiply a string by a number to get a repetition, you can multiply a list by a number to get a new list with the items repeated. Just as the characters in a string are indexed starting at zero, so are the items in the list. Let's see that in the shell where we'll set up a list of numbers. You can use zero as an index or a positive number, which proceeds from the beginning towards the end of the list. As with strings, a negative index starts at the end of the list with an index of negative one and proceeds towards the beginning of the list. You can get a slice of a list starting at the first index that you give up to, but not including, the ending index. If you leave off the first number, the slice begins at the beginning of the list, and if you leave off the second number, the slice goes to the end of the list. Finally, you can use the in and not in operators to see if an item is in a list. Is 103 in numbers? True. Is 107 in numbers? False. Is 199 not in numbers? That's true. 102 not in numbers is false. You can also use the index method to find where an element is in a list. I can say numbers.index 105 and that gives me the position. But beware, if an item isn't in the list, you'll get a value error at runtime. It's possible to combine the in operator with the index method to make a safe index function, as shown here. We'll give the safe index function a list to work with and an item to find. If the item is in the list, we'll return its index. Otherwise, it's not in the list and we'll return a negative one. Now, when we call our safe index function to find out if 199 is in the numbers list, we'll get a negative one indicating that it wasn't in the list and those are the basic operations on lists.