 In most programs, all the items in a list will have the same data type. But there's no law that says they have to. You can create lists with different data types for each item. Since lists are a data type, you can even have lists whose items are other lists. These nested lists can be very useful. Consider this table of quarterly sales over three years. Yes, the numbers are made up because I wanted an example that doesn't use semi-random data. How do we represent this table in Python? We do it by putting each row in its own set of brackets. Each row is a sub-list of the main list. Here's what it looks like internally. Sales is a reference to a list of length three, as there are three rows, but the items in that list is a reference to another sub-list with the items for that row. Here's the list in Thani. If I ask for the length of the sales list, I get three. There are three rows. If I want to find out how many columns the list has, I look at the length of one of the rows, the sub-lists. I want the length of item zero in the sales list, which is the length of the first row, and there are four items in it. In this nested list, all the sub-lists have the same number of elements. But because of the way Python stores nested list, there's no law that says the sub-lists have to have the same length. To access an individual item in a nested list, you need to use two sets of square brackets with the row number first, then the column number. Let's write code to get the grand total of this nested list. Our grand total starts out at zero. After setting the total to zero, we'll need a nested loop to process our nested list. The outer loop will traverse the rows, and the inner loop will process each item in a row, and we'll add that item to the grand total. Once our nested loop is finished, we can print the result. Grand total, and let's run the program, and there's our answer. Let's print a blank line for readability in our output, and continue for the yearly totals. We're going to establish our base year for these sales as 2016. I'm using all capital letters to let other programmers know this should be treated as a constant. We'll want to print the year with each total, so let's set a variable for the current year, and we'll start it at our base year. In this loop, we're going to go through each row in sales, which represents a year, and every time we have a new year, we have to set the yearly total back to zero. And then run the loop through each item in the row, and add that to our yearly total. After we process a row, we print its results. The total for the year is yearly total thousand units. Important, this is still inside the row loop. We need to print this after we process each row. And after each row is done, we have to add one to the year. And let's run the program and see how that works. And there are the yearly totals. Let's print another blank line for readability in our output. And finally, print the quarterly totals. This time our outer loop tells which quarter it is, and it's going to iterate over the columns. We're going to need to index to do this. We're going to have to have our quarter in range four. Every time we want a new quarter, we have to set our quarterly total to zero. And our inner loop will go through the rows. How many rows are there? As many rows as there are in the sales list. We're going to add the data from the given row and quarter we want to the total. The quarterly total plus and becomes the sales at the given row for the quarter we're working with. It's very important to note that when you access an item in a nested list, you always put the row index first. Even though the row may not be your outer loop. Once we've processed all the rows for a quarter, we print its total. Total for Q quarter plus one, and I'm adding one. Remember, our range four goes from zero to three. But users will expect our quarter numbers to go from one to four, and that's why I'm adding one here. And then quarterly total, thousand units. Let's run that. And there are the results. And that's an example of how to work with nested lists.