Write a python function that takes two lists as an input an print out common elements in two lists


Topic: Write a python function that takes two lists as an input an print out common elements in two lists

Solution

def common_member(a, b): 
    a_set = set(a) 
    b_set = set(b) 
  
    if (a_set & b_set): 
        print(a_set & b_set) 
    else: 
        print("No common elements")  
        



List all Python Programs