python 旋转数组

#!/usr/bin/env python3
#-*-encoding:utf-8-*-
l = []
u = []
q = 5

xx=[[col for col in range(q)] for r in range(q)]
[print(i) for i in xx]

for i in range(len(xx)):
    for v in xx:
       # print(v[i])
        l.append(v[i])
        if len(l) == q:
            u.append(l)
            l = []
print('\n')
for i in u:
    print(i)

 

posted @ 2016-08-09 22:36  若丶相依  阅读(324)  评论(0编辑  收藏  举报