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:
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
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]]](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F933459c6-62f9-4759-a5e3-d917a2abbbd7%2Fabb19380-dea9-494e-9cb0-4f96b6053be0%2Flmprene_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning