Square-ish matrix
Input
transpose([[1,2,3],[4,5,6]])
Output
[[1, 4], [2, 5], [3, 6]]
Standard transpose: columns become rows.
Full lesson preview
Write a transpose function for 2D lists that handles regular and irregular rows by filling missing entries with None.
Problem statement
Task
Examples
Input
transpose([[1,2,3],[4,5,6]])
Output
[[1, 4], [2, 5], [3, 6]]
Standard transpose: columns become rows.
Input format
Output format
Constraints
Samples
Input
transpose([[1,2],[3]])
Output
[[1, 3], [2, None]]
Second row is shorter, so the missing entry in the second column is None.