![图片[1]-python3中矩阵如何表示?-uusu优素-乐高,模型,3d打印,编程](http://uusucn.zbbe.cn/wp-content/uploads/2024/01/5ecb6387dc971860.jpg)
python中表示矩阵的方法:
python中可以利用列表中夹带列表形式表示。
示例:(表示下列矩阵)

使用下面的代码即可:
count=1 a=[] foriinrange(0,3): tmp=[] forjinrange(0,3): tmp.append(count) count+=1 a.append(tmp) printa
结果:
原文来自:https://www.py.cn[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容