Question: [2.5pts] Write the function common(list), list2) that takes two lists, listl and list2, and returns (not prints) a new list containing only the elements that

 [2.5pts] Write the function common(list), list2) that takes two lists, listl

[2.5pts] Write the function common(list), list2) that takes two lists, listl and list2, and returns (not prints) a new list containing only the elements that are common between the two lists in descending order (without duplicates). Make sure your code works on lists of different sizes. Your code should not mutate the given lists. Hint: reverse sorting could be useful here

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!