Question: Python programming | 75.5% it through CodeLoad and by creating your own test cases Part I: Interleave: Fix Errors) (20 points) In the Fix Error

 Python programming | 75.5% it through CodeLoad and by creating your

Python programming

| 75.5% it through CodeLoad and by creating your own test cases Part I: Interleave: Fix Errors) (20 points) In the Fix Error type of problems, you will be given a problem as usual, but with a buggy "solution" provided for you. Your task is to find the ermors) and make the function work properly. Note that you are free to just rewrite CSE 101-Fall 2017 Lab #3 Page I the solution yourself, but as the problems get harder, it might be easier to find the ermor rather than rewrite the whole function. Fix the function interleave () which takes as its only argument a list called nums, which contains integers sub-lists. Create a new list by interleaving the lists of integers and return the interleaved list. This process is most easily understood by looking at an cx ample. Example: Let's consider a list of two sub-lists, with three elements per sub-list [11, 2,31, 14,5, 61 The first clement of the first list (denoted nums [0j 0]will be the first element of the new list. .The first element of the second list (denoted nums 111 10]) will be the second element of the new list The second clement of the first list idenoted nums [0] 1]) will the third clement of the new list . The second element of the second list (denoted nums[11 [1) will he the fourth element of the new list. . The third element of the first list (denoted nums [ [2] ) will the fifth element of the new list. The third element of the second list (denoted numa 11 [2])will be the sixth element of the new list. The final list will be: 11,4,2,5, 3, 6] Note: You may assume that all sub-lists in nums will have same number of elements. If the list or the sub-lists are empty list(s), the return value should be an empty list Examples: Function Call Return Value 1, 4, 7, 2, 5, 8, 3, 6, 9) interleave([[1, 2, 31, 14, 5, 6), [7, 8, 9111 interleave (I[0,1,0, (1,0,0), [0, 0,1]]) interleave (I [1, 2], 13,41, I5, 61, 17,81. 9, 01 0, 2, 0, 1, 0, 0, 0, 0, 11 L,3, 5,7, 9, 2, 4, 6, B, Oj Remember: Codel oad has additional tests for you to uy! up against harder tests. Upload your code there and see how your code matches

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!