Objective
A matrix is a list of lists. Summing each row is direct with sum(row); for the columns, zip(*m) transposes it.
Instructions
- The first line has the number of rows
fand columnsc; then comeflines with the values separated by spaces. - Show
Rows: ...with the sum of each row andColumns: ...with that of each column, values separated by spaces.
2 3
1 2 3
4 5 6
Rows: 6 15
Columns: 5 7 9
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise