Question: Part IV: Untangling a List (20 points) Write a function untangle ) that takes the following arguments, in this order 1. numbers: a list of

 Part IV: Untangling a List (20 points) Write a function untangle

Part IV: Untangling a List (20 points) Write a function untangle ) that takes the following arguments, in this order 1. numbers: a list of integers 2. len.of.sublist: a positive integer that is used to divide the list into several sub-lists; see below for more details. You may assume that the length of numbers is always a divisible by len.of.sublist. The function splits the list of into a list of sub-lists. How this is done is most easily understood by example. Suppose the given list numbers is [ 5, 6, 7, 8, 9, 10] and len-of-sublist is 2This value of len-of-sublist indicates that each sub-list will have two items. Note that numbers contains 6 elements. Therefore, there will be 3 sub-lists because 6/3-2 1The first integer (5) goes into the first sub-list. CSE 101 -Fall 2017 Page 3 2. The second integer (6) goes into the second sub-list. 3. The third integer (7) goes into the third sub-list. 4. The fourth integer (8) goes into the second position of the first sub-list. 5. The fifth integer(9) goes into the second position of the second sub-list. 6. The sixth integer (10) goes into the second position of the third sub-list The returned list of lists will be: [5,81, 16,91, [7,101 Examples: Function Call untangle ([1,2,3,4,5, 6], 2) untangle ([1,4,7,2,5,8,3,6,9], 3)[[1,2,3], [4,5, 6], [7,8,9]] untangle ([1,2,3], 1) Return Value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!