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:

Matrix

Useful link:

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

3-Dimensional Array Defination:

3-D array defination
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 教书多年了,上课一直坚持用普通话,但在生活中则难舍乡音。一家人操着地道的鲁北口音,亲情浓浓的,特别熨帖。 并不是所...
    格尔黑阅读 263评论 2 7
  • 记得对联一副,上联“柴米油盐酱醋茶”,下联“琴棋书画诗酒花”。 这幅对联特别让我印象深刻,它把艺术生活化了,其实艺...
    勾勾5阅读 1,329评论 0 2
  • 1.看完50本书,写20万字。 Ps :2016年写了73000字。看了20本书。 2.去学习瑜伽课程一次,冥想课...
    曾曾的麻麻阅读 312评论 0 0

友情链接更多精彩内容