CSC 127A Lecture 25: CSC 110 Week 9 10.19.16
Document Summary
To access nested lists, or a list inside of a list. list = [[1,2,3],[4,5,6],[7,8,9],[0,9,8]: the outer list has 4 lists inside of it, and those will be numbered 0-3, for instance, picking list [2] will be [7,8,9] To access the nine, use [2], because 7 is at [0], 8 is at [1] and 9 is at [2] list = [2][2] When i = 0 j = 0 and j = 1. When i = 1 j = 0 and j = 1. Through the loops, when myster(grid, 2, 2): we will get the following: Think of these as coordinates for the grid, in grid [2], line number [2], we will find 6. 0 + 0 = [0], 0 + 0 = [0]. For when mystery(grid, 3, 3), this extends i in the range to 2, which will give us 6 total coordinates for numbers in the grid.