用Python编写一个4*6矩阵逆序
时间: 2023-05-19 07:06:54 浏览: 124
使用Python实现分别输出每个数组
下面是用Python编写一个4*6矩阵逆序的代码:
```python
matrix = [[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24]]
for row in matrix:
print(row[::-1])
```
输出结果为:
```
[6, 5, 4, 3, 2, 1]
[12, 11, 10, 9, 8, 7]
[18, 17, 16, 15, 14, 13]
[24, 23, 22, 21, 20, 19]
```
阅读全文