Write a Python function that takes two lists and returns True if they have at least one common member

def func(lst1, lst2):
    for item in lst1:
        if item in lst2:
            return True


list1 = [1, 2, 5, 9]
list2 = [3, 8, 4, 9]

#driver code
print(func(list1, list2))


Follow on:
Sunil Shaw

Sunil Shaw

About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page