Write a python function that returns a list of elements that exist in both user provided lists.


Topic: Write a python function that returns a list of elements that exist in both user provided lists.

Solution

def similarity(a, b):
  return [item for item in a if item in b]



List all Python Programs