a = [[0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3]]
目前通过a可以获取如下格式:
[0,1,2,3]
[0,1,2,3]
[0,1,2,3]
[0,1,2,3]
现在想要通过a得到如下格式:
[0,0,0,0]
[1,1,1,1]
[2,2,2,2]
[3,3,3,3]
如何实现上面的要求?
本文共 225 字,大约阅读时间需要 1 分钟。
a = [[0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3]]
目前通过a可以获取如下格式:
[0,1,2,3]
[0,1,2,3]
[0,1,2,3]
[0,1,2,3]
现在想要通过a得到如下格式:
[0,0,0,0]
[1,1,1,1]
[2,2,2,2]
[3,3,3,3]
如何实现上面的要求?
转载于:https://blog.51cto.com/kevinhao/1793399