subject

Write a function transpose(matrix) that returns the transpose of the input matrix, which is represented as a list of lists. Recall that the transpose of a matrix is obtained by swapping its rows with its columns. More concretely, the equality matrix[i][j] transpose(matrix)[j][i] should hold for all valid indices i and j. You may assume that the input matrix is well-formed, i. e., that each row is of equal length. You may further assume that the input matrix is non-empty. Your function should not modify the input. transpose([[1, 2, 3]]) [[1], [2], [3]] transpose([[1, 2], [3, 4], [5, 6]]) [[1, 3, 5], [2, 4, 6]]

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, mmimay3501
What do character formats do for your document's message? a. set the tone b. provide organization c. provide clarity d. set how texts align with documents
Answers: 2
image
Computers and Technology, 23.06.2019 02:50, bfell92
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, ilovewaffles70
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
image
Computers and Technology, 24.06.2019 07:30, sunny644
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
You know the right answer?
Write a function transpose(matrix) that returns the transpose of the input matrix, which is represen...

Questions in other subjects:

Konu
Mathematics, 21.10.2020 21:01