Loading tutorials
for loops. It also assumes you have seen a 2D array as a list of rows. Here you will learn how a pair of indices selects one cell, how to update cells, and which errors to expect.2 min readgrid[row][col]. Here you will learn the standard ways to create a 2D array and the one mistake that catches almost everyone.2 min readfor loops, range, and zero-based indexing. You should also know how a 2D array is stored as a list of row lists, and how grid[r][c] reads one cell.2 min readfor loops, index a Python list, and read a nested list as a grid with grid[row][column]. If those are new, review the earlier chapters on indexing and traversal first.3 min readfor loops, index a Python list with zero-based indices, and build a 2D array as a list of lists. Earlier chapters showed how to visit every cell with an outer loop over rows and an inner loop over columns. Here you will see that this is one of two natural 2 min readgrid[r][c], write nested for loops, and use a generator with yield. Many grid problems, such as flood fill, path finding, and cell counting, share one step: visit the cells next to a given cell. This chapter shows how to do that without ind2 min readgrid[r][c], write nested for loops, and use list comprehensions. It covers what a transpose is, two ways to compute it in Python, and the errors that come up most often.2 min readfor loops, and use list comprehensions. Both operations here are element-wise: each result cell depends only on the cell at the same position in the inputs.2 min readgrid[r][c], and build a 2D list without shared rows. Here you will multiply two matrices by hand and in code, and learn what it costs.2 min readgrid[r][c], write nested loops, and use len(). It explains how a table of rows and columns fits into memory, which is a single line of cells.3 min readlen(). You should also know the shape idea from earlier chapters: an m by n grid has m rows and n columns.2 min read