Question: In python 1. (Lists) Write the function remove duplicates(L) that receives a list L and returns a new list with all duplicated elements removed. 2.

In python

In python 1. (Lists) Write the function remove duplicates(L) that receives a

1. (Lists) Write the function remove duplicates(L) that receives a list L and returns a new list with all duplicated elements removed. 2. (Arrays) Write the function sum rows(A) that receives a2D array A and returns a 1D array containing the sum of each row of A. 3. (Sets) Write the function common elements (L1,L2) that receives two lists L1 and L2 and returns a set containing the elements that appear in both L1 and L2. (Dictionaries) Write the function frequency of words(S) that receives a string S and returns a dictionary containing the frequency of each word in S. 4. (Lists) Write the function merge(L1, L2) that receives two sorted lists L1 and L2 and returns a new sorted list containing all elements from both L1 and L2. 5. (Arrays) Write the function average diagonals(A) that receives a 2D array A and returns the average of the elements in the two main diagonals of A. 6. (Sets) Write the function unique elements( L) that receives a list L and returns a set containing the unique elements of L. 7. (Dictionaries) Write the function word count(S) that receives a string S and returns a dictionary containing the count of each word in S. 8. (Lists) Write the function split (L,k) that receives a list L and an integer k and returns two new lists, one containing the first k elements of L and the other containing the rest of the elements. 9. (Arrays) Write the function sum columns(A) that receives a 2D array A and returns a 1D array containing the sum of each column of A. 10. (Sets) Write the function disjoint sets(L1, L2) that receives two sets L1 and L2 and returns True if they are disjoint (have no elements in common) and False otherwise. 11. (Dictionaries) Write the function reverse lookup(D, v) that receives a dictionary D and a value v and returns a list of all keys in D that map to v

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!