Loading...
Loading...
Loading...
A table of r rows and c columns shows monthly figures. Print its transpose: the new table has c rows and r columns, where the item at row i and column j becomes the item at row j and column i.
Example
Input
2 3 1 2 3 4 5 6
Output
1 4 2 5 3 6
Rows become columns.
Try the problem first. Open one hint at a time.
Read the rows into a list of lists first.
The new row j is made of the item in column j of every old row.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor