Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can iterate over a multi-dimensional array in Python using nested loops. Here's an example:

my_array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

for i in range(len(my_array)):
    for j in range(len(my_array[i])):
        print(my_array[i][j])

In this example, i represents the row index, and j represents the column index. We use len to determine the sizes of the arrays, and then iterate through each element using the indices. We can then perform any operation we want on each element, such as printing it to the screen.