Question: 5. (Lists) Write the function interleave (L1,L2) that receives two lists of the same length L1 and L2 and returns a list containing [L1[0],L2[0],L1[1],L2[1],L1[2],L2[2],]. 6.

 5. (Lists) Write the function interleave (L1,L2) that receives two lists

5. (Lists) Write the function interleave (L1,L2) that receives two lists of the same length L1 and L2 and returns a list containing [L1[0],L2[0],L1[1],L2[1],L1[2],L2[2],]. 6. (Arrays) Write the function sum_corners (A) that receives a 2D array A and returns the sum of the items in the four corners of A. Assume A has at least two rows and two columns. 7. (Sets) Write the function appears_in_1(L1,L2) that receives two lists of integers L1 and L2 and returns a set containing the elements that appear in L1 or in L2 but not in both. 8. (Dictionaries) Write the function occurrences (S,n) that receives a string S and an integer n and builds and returns a dictionary containing the number of times each substring of S of length n appears in S

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!