PythiloEasy · 12 min · Task 30 of 100 · progress kept in this browser

Transpose a rectangle

Return the transpose of a rectangular matrix as lists. Return [] for [] or rows with zero columns.

matrix = [[1, 2, 3], [4, 5, 6]]
print(list(zip(*matrix)))
Your task

Return the transpose of a rectangular matrix as lists. Return [] for [] or rows with zero columns.