Complete the transform_2d_list() function that takes a single two-dimensional list as a parameter called a_2d_list. The parameter list has m items, where each item is a list with n items. The function returns a new two-dimensional list, where the first item is a list containing all of the first items in the list items of the original list, and the second item is a list containing all of the second items in the list items of the original list and so on. In other words, the two- dimensional list that is returned will have n items, where each item is a list with m items. You can assume that both m and n are at least 1. Some examples of the function being called are shown below. For example:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question
10
mplete
out of
question
Complete the transform_2d_list() function that takes a single two-dimensional list as a
parameter called a_2d_list. The parameter list has m items, where each item is a list with n
items. The function returns a new two-dimensional list, where the first item is a list containing all
of the first items in the list items of the original list, and the second item is a list containing all of
the second items in the list items of the original list and so on. In other words, the two-
dimensional list that is returned will have n items, where each item is a list with m items. You can
assume that both m and n are at least 1. Some examples of the function being called are shown
below.
For example:
Test
a_2d_list = [[1]]
print (transform_2d_list (a_2d_list))
a_2d_list = [['a'], ['b']]
print (transform_2d_list (a_2d_list))
a_2d_list = [[1, 2], [3, 4]]
print(transform 3d lint(
Result
[[1]]
[['a', 'b']]
[[1, 3], [2, 4]]
Transcribed Image Text:10 mplete out of question Complete the transform_2d_list() function that takes a single two-dimensional list as a parameter called a_2d_list. The parameter list has m items, where each item is a list with n items. The function returns a new two-dimensional list, where the first item is a list containing all of the first items in the list items of the original list, and the second item is a list containing all of the second items in the list items of the original list and so on. In other words, the two- dimensional list that is returned will have n items, where each item is a list with m items. You can assume that both m and n are at least 1. Some examples of the function being called are shown below. For example: Test a_2d_list = [[1]] print (transform_2d_list (a_2d_list)) a_2d_list = [['a'], ['b']] print (transform_2d_list (a_2d_list)) a_2d_list = [[1, 2], [3, 4]] print(transform 3d lint( Result [[1]] [['a', 'b']] [[1, 3], [2, 4]]
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning