python二维数组行列互换

"""
给定一个m*n阶的二维数组,返回n*m阶二维数组,也就是行列互换
eg:
input: arr = [[1,2,3],[1,2,3]]
output: arr = [[1,1],[2,2],[3,3]]
"""
def func(arr, m, n):
    res = [[row[i] for row in arr] for i in range

你可能感兴趣的:(python基础题)