像素翻转

#coding=utf-8
class Transform:
    def transformImage(self, mat, n):
        res = []
        for i in range(n):
            rest =[]
            for j in range(n-1,-1,-1):
                rest.append(mat[j][i])
            res.append(rest)
        return res

a = Transform()
a.transformImage([[1,2,3],[4,5,6],[7,8,9]],3)

编程技巧