二维数组旋转90°

a =[ [col for col in  range(4)] for row in  range(4)]
for i in a :
print(i)
print('------------------')
for h,zhi in enumerate(a):
for l in range(h,len(zhi)):
tem = a[l][h]
a[l][h] = a[h][l]
a[h][l] = tem
for j in a :
print(j)
posted @ 2017-09-04 19:41  王盼0810  阅读(107)  评论(0编辑  收藏  举报