Two-Dimensional Array Defination in Python

In Python, a multi-dimensional table like this can be implemented as a sequence of sequences. A table is a sequence of rows. Each row is a sequence of individual cells. This allows us to use mathematical-like notation. Where the mathematician might sayAi,j, in Python we can sayA[i][j]. In Python, we want the rowifrom table A, and columnjfrom that row.

This looks remarkably like thelistoftuples we discussed inthe section called “Lists of Tuples”. 

2-Dimensional Metrix sample code:

Two-Dimensional Array Defination in Python_第1张图片
Matrix

Useful link:

http://www.linuxtopia.org/online_books/programming_books/python_programming/python_ch20s05.html

3-Dimensional Array Defination:

Two-Dimensional Array Defination in Python_第2张图片
3-D array defination

你可能感兴趣的:(Two-Dimensional Array Defination in Python)