class Solution:
    # matrix类型为二维列表,需要返回列表
    def printMatrix(self, matrix):
        # write code here
        a = []
        while matrix:
            for j in range(len(matrix[0])):
                a.append(matrix[0][j])
            matrix = list(map(list,zip(*matrix[1:])))[::-1]
        return a